Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

fix(alerts-mcp): escape the apostrophe that made create_alert_rule a syntax error and break the package

nirholasdbcee4f93925
diff --git a/packages/alerts-mcp/src/tools/create-alert-rule.js b/packages/alerts-mcp/src/tools/create-alert-rule.js
index eacf871b2..16031fea7 100644
--- a/packages/alerts-mcp/src/tools/create-alert-rule.js
+++ b/packages/alerts-mcp/src/tools/create-alert-rule.js
@@ -23,7 +23,7 @@ export const def = {
'Create a pump.fun alert rule on the authenticated three.ws account. The pumpfun-monitor cron ' +
'evaluates it against the live event stream and delivers across the channels you enable, so it ' +
'fires across devices with no dashboard open. NOT idempotent — each call adds a new rule (max 50 ' +
- 'per account). Targeting by kind: `market_anomaly` watches the whole market (no target) and takes optional `filters` (processors, min_severity, subject) over the scanner's price, TVL, stablecoin, funding and open-interest events; `graduation` is global or scoped to target_mint OR target_agent; ' +
+ 'per account). Targeting by kind: `market_anomaly` watches the whole market (no target) and takes optional `filters` (processors, min_severity, subject) over the scanner\'s price, TVL, stablecoin, funding and open-interest events; `graduation` is global or scoped to target_mint OR target_agent; ' +
'`price_above` / `price_below` / `whale_buy` require target_mint; `new_mint` requires target_agent. ' +
'`threshold` is required for the price/whale kinds — USD market cap for price_above/price_below, ' +
'minimum buy size in SOL for whale_buy. At least one delivery channel must be on (deliver_in_app ' +
diff --git a/tests/alerts-mcp-tool-sources.test.js b/tests/alerts-mcp-tool-sources.test.js
new file mode 100644
index 000000000..44ae33e8d
--- /dev/null
+++ b/tests/alerts-mcp-tool-sources.test.js
@@ -0,0 +1,17 @@
+// Every alerts-mcp tool file must load. create_alert_rule once shipped an
+// unescaped apostrophe inside a single-quoted description, which made the whole
+// module (and the golden-contract audit that parses it) a SyntaxError.
+import { describe, it, expect } from 'vitest';
+import { readdirSync } from 'node:fs';
+import { fileURLToPath } from 'node:url';
+
+const dir = fileURLToPath(new URL('../packages/alerts-mcp/src/tools/', import.meta.url));
+const files = readdirSync(dir).filter((f) => f.endsWith('.js') && f !== 'index.js');
+
+describe('alerts-mcp tool sources', () => {
+ it.each(files)('%s loads and declares a described tool', async (file) => {
+ const mod = await import(`${dir}${file}`);
+ expect(mod.def?.name).toMatch(/^[a-z][a-z0-9_]+$/);
+ expect(mod.def.description.length).toBeGreaterThan(40);
+ });
+});