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.

feat(mcp-agent): mirror the 17 named commerce tools on the hosted agent wallet

nirholas9d88c7f9dfb3
diff --git a/api/_mcpagent/catalog.js b/api/_mcpagent/catalog.js
index f1dbf8305..82f17c398 100644
--- a/api/_mcpagent/catalog.js
+++ b/api/_mcpagent/catalog.js
@@ -15,9 +15,11 @@ import { duelToolDefs } from './duels-tools.js';
import { commerceToolDefs } from './commerce-tools.js';
import { eventMarketToolDefs } from './event-markets-tools.js';
import { eventMarketForecastToolDefs } from './event-market-forecast-tools.js';
+import { namedServiceToolDefs } from './named-services-tools.js';
const toolDefs = [...walletToolDefs, ...marketplaceToolDefs, ...predictionToolDefs, ...perpsToolDefs, ...papertradeToolDefs, ...tradingToolDefs,
- ...portfolioToolDefs, ...sniperAlertToolDefs, ...duelToolDefs, ...commerceToolDefs, ...orderToolDefs, ...eventMarketToolDefs, ...eventMarketForecastToolDefs];
+ ...portfolioToolDefs, ...sniperAlertToolDefs, ...duelToolDefs, ...commerceToolDefs, ...orderToolDefs, ...eventMarketToolDefs, ...eventMarketForecastToolDefs,
+ ...namedServiceToolDefs];
// Free, public entry point, listed first so discovery clients see it up top.
// Annotations: a static, local overview built at module load: read-only,
diff --git a/api/_mcpagent/discovery.js b/api/_mcpagent/discovery.js
index bfd16c0ef..019b6a7af 100644
--- a/api/_mcpagent/discovery.js
+++ b/api/_mcpagent/discovery.js
@@ -32,14 +32,32 @@ export const RESOURCE_DESCRIPTION =
'predictions_watch. Perpetual futures with USDC collateral on Solana, paper or live: perps_markets, ' +
'perps_market_data, perps_account, perps_positions, perps_order_preview, perps_action_preview, ' +
'perps_order_execute, perps_collateral_deposit, perps_collateral_withdraw, perps_order_cancel, ' +
- 'perps_flatten and perps_limits. Resting orders and DCA on any SPL token: order_preview, limit_order_create, ' +
+ 'perps_flatten and perps_limits. Synthetic perps on HyperEVM, paper money only: papertrade_markets, ' +
+ 'papertrade_quote, papertrade_account and papertrade_protocol. ' +
+ 'Resting orders and DCA on any SPL token: order_preview, limit_order_create, ' +
'stop_order_create, trailing_order_create, ladder_order_create, oco_order_create, limit_order_list, ' +
'limit_order_cancel, limit_order_history, order_book, dca_preview, dca_create, dca_list and dca_cancel. ' +
'Solana trading: token_search, get_price, get_indicators, get_market_signals, get_news_feed, ' +
'arbitrage_prices, arbitrage_quote, swap_quote (every aggregator compared on net output), swap_simulate ' +
- 'and swap_execute. ' +
+ 'and swap_execute. Portfolio reads: get_portfolio, get_balance_history and get_pnl. ' +
+ 'Launch sniper, signal subscriptions and alert rules: sniper_status, sniper_activate_preview, ' +
+ 'sniper_activate, sniper_deactivate, sniper_subscribe, alert_rule_create, alert_rule_list and ' +
+ 'alert_rule_delete. Agent duels settled in USDC: duel_challenge, duel_accept, duel_details and ' +
+ 'duel_markets. Agent-to-agent commerce: invoice_create, invoice_details, invoice_list, invoice_verify, ' +
+ 'invoice_cancel, agent_send_preview, agent_send, offer_list, agent_sell, agent_buy, agent_buy_confirm, ' +
+ 'spending_check and spending_setup. ' +
'Free-to-play Event Markets, points only: event_markets_list, event_market, event_market_pick, ' +
'event_market_analyze, event_market_forecasters and event_market_agent_pick. ' +
+ 'Named commerce tools that pay a fixed three.ws x402 service from your agent wallet, each with a ' +
+ '_quote counterpart that prices it without paying: weather_forecast_quote and weather_forecast, ' +
+ 'weather_go_no_go_quote and weather_go_no_go, carbon_now_quote and carbon_now, ' +
+ 'carbon_best_window_quote and carbon_best_window, domain_rdap_check_quote and domain_rdap_check, ' +
+ 'domain_rdap_check_bulk_quote and domain_rdap_check_bulk, research_search_quote and research_search, ' +
+ 'research_paper_quote and research_paper, research_bibliography_quote and research_bibliography, ' +
+ 'book_search_quote and book_search, book_read_quote and book_read, news_wire_search_quote and ' +
+ 'news_wire_search, news_wire_poll_quote and news_wire_poll, transit_plan_quote and transit_plan, ' +
+ 'transit_delays_quote and transit_delays, places_search_quote and places_search, and ' +
+ 'places_detail_quote and places_detail. ' +
'Every money-moving tool needs its preview first and an explicit confirm flag. ' +
'Connect with a three.ws account (OAuth) or pay per call in USDC on Base or Solana mainnet, no ' +
'API key. Operated by three.ws.';
diff --git a/api/_mcpagent/dispatch.js b/api/_mcpagent/dispatch.js
index 7eeff9e3d..7cf6369d0 100644
--- a/api/_mcpagent/dispatch.js
+++ b/api/_mcpagent/dispatch.js
@@ -61,6 +61,13 @@ const INSTRUCTIONS = [
'with confirm_order: true, or dca_create with confirm_dca: true. order_book shows next fire times and why',
'an order skipped; limit_order_list, limit_order_history and dca_list read; limit_order_cancel and',
'dca_cancel stop orders and never move funds.',
+ 'Named commerce tools pay one fixed three.ws x402 service each, cheaper to reason about than a raw',
+ 'pay_and_call(resource_url): weather_forecast, weather_go_no_go, carbon_now, carbon_best_window,',
+ 'domain_rdap_check, domain_rdap_check_bulk, research_search, research_paper, research_bibliography,',
+ 'book_search, book_read, news_wire_search, news_wire_poll, transit_plan, transit_delays, places_search',
+ 'and places_detail. Each has a _quote twin (e.g. weather_forecast_quote) that prices it without paying;',
+ 'show the user that table, wait for a clear yes, then call the paying tool with its preview_id and',
+ 'confirm_payment: true.',
].join(' ');
export const dispatch = makeDispatcher({
diff --git a/api/_mcpagent/named-services-tools.js b/api/_mcpagent/named-services-tools.js
new file mode 100644
index 000000000..81715b5c6
--- /dev/null
+++ b/api/_mcpagent/named-services-tools.js
@@ -0,0 +1,214 @@
+// threews-agent MCP: named commerce tools, hosted mirror of
+// packages/x402-mcp/src/tools.json. Order 521 built the stdio package's 17
+// fixed-endpoint, fixed-price tools (weather_forecast, domain_rdap_check, ...);
+// this file gives the hosted agent the SAME names, prices and schemas so a
+// client sees one consistent catalog regardless of which three.ws MCP server
+// it talks to. Only the payer differs: the stdio tools sign with a local
+// Solana key, these pay from the signed-in user's own three.ws agent wallet
+// (payExternalX402, the same rail pay_and_call already uses).
+//
+// Each service name N gets a pair:
+// N_quote (read) prices the fixed endpoint, never pays. Reuses the
+// same probePrice/selectRail pay_quote uses.
+// N (financial) pays it. Gated by the shared policy runtime
+// (packages/mcp-policy): needs N_quote's preview id
+// plus confirm_payment: true. N_quote's preview tool
+// name is unique to this one service, so its id can
+// never unlock a different (cheaper or costlier)
+// service's payment.
+//
+// Tool policy rows live in packages/mcp-policy/src/table.js under
+// 'threews-agent', one r()/f() pair per service, generated by the same
+// registry this file reads.
+
+import { createRequire } from 'node:module';
+
+import { limits } from '../_lib/rate-limit.js';
+import { env } from '../_lib/env.js';
+import { hasScope } from '../_lib/auth.js';
+import { getUserWalletStatus, payExternalX402, resolveSpendEnabled } from '../_lib/x402-user-payer.js';
+import { probePrice, selectRail } from '../_lib/pay/probe.js';
+import {
+ enforce,
+ payLink,
+ agreementRequired,
+ scopeRequired,
+ chainLabel,
+ quoteRefusal,
+ payBlockers,
+} from './tools.js';
+
+const require = createRequire(import.meta.url);
+const registry = require('../../packages/x402-mcp/src/tools.json');
+
+function serviceUrl(entry, args) {
+ const url = new URL(entry.path, env.APP_ORIGIN);
+ if (entry.method === 'GET') {
+ for (const [key, value] of Object.entries(args || {})) {
+ if (value === undefined) continue;
+ url.searchParams.set(key, Array.isArray(value) ? value.join(',') : String(value));
+ }
+ }
+ return url.toString();
+}
+
+function quoteToolName(entry) {
+ return `${entry.name}_quote`;
+}
+
+function buildQuoteTool(entry) {
+ return {
+ name: quoteToolName(entry),
+ title: `Price ${entry.title} without paying`,
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: false, openWorldHint: true },
+ description: `Price three.ws's ${entry.title} (${entry.method} ${entry.path}, listed at $${entry.priceUsd}) without paying: returns the confirmation table ${entry.name} would settle from your agent wallet. Call this before ${entry.name}; it needs the quote_id this returns.`,
+ inputSchema: entry.inputSchema,
+ async handler(args, auth) {
+ await enforce(limits.mcpAgent, auth);
+ const url = serviceUrl(entry, args);
+ const probe = await probePrice(url, { method: entry.method, body: entry.method === 'POST' ? args : null });
+ if (probe.kind === 'error') {
+ return quoteRefusal(url, probe.code, `Could not price ${entry.title}: ${probe.message}.`);
+ }
+ const rail = probe.kind === 'priced' ? selectRail(probe.rails, 'solana') : null;
+ if (probe.kind === 'priced' && !rail) {
+ const offered = [...new Set(probe.rails.map((r) => r.network).filter(Boolean))];
+ return quoteRefusal(
+ url,
+ 'no_solana_rail',
+ `${entry.title} does not accept payment on Solana (it offers ${offered.join(', ') || 'no readable network'}).`,
+ { networks: offered },
+ );
+ }
+ if (rail && rail.amount_usd == null) {
+ return quoteRefusal(url, 'unreadable_price', `${entry.title} sent a payment challenge whose amount could not be read.`);
+ }
+ const priceUsd = rail ? rail.amount_usd : 0;
+
+ const canReadWallet =
+ Boolean(auth.userId) && (hasScope(auth.scope, 'wallet:read') || hasScope(auth.scope, 'wallet:write'));
+ const wallet = canReadWallet ? await getUserWalletStatus(auth.userId) : null;
+ const capPerCall = wallet?.caps?.max_per_call_usdc ?? null;
+ const perCallLimit = capPerCall;
+ const spendEnabled = resolveSpendEnabled();
+ const blockers = payBlockers({ auth, spendEnabled, wallet, priceUsd, perCallLimit });
+ const hard = blockers.filter((b) => b.hard);
+
+ const token = rail ? (rail.usdc ? 'USDC' : String(rail.asset ?? 'unknown token')) : null;
+ const lines = [`Payment preview for ${entry.title} (nothing was paid):`];
+ if (rail) {
+ lines.push(
+ ` Recipient: ${rail.pay_to ?? 'not stated by the service'}`,
+ ` Amount: ${priceUsd} ${token}`,
+ ` Token: ${token}${rail.asset ? ` (${rail.asset})` : ''}`,
+ ` Chain: ${chainLabel(rail.network)}`,
+ );
+ } else {
+ lines.push(` This endpoint did not ask for payment, so ${entry.name} would call it and pay nothing.`);
+ }
+ if (wallet?.provisioned) lines.push(` From: ${wallet.address} (${wallet.balances?.usdc ?? '?'} USDC)`);
+ if (perCallLimit != null) lines.push(` Per-call limit: $${perCallLimit}`);
+ for (const b of blockers) lines.push(` ${b.hard ? 'Blocked' : 'Note'}: ${b.message}`);
+ if (!auth.userId || !spendEnabled) lines.push(` Pay manually: ${payLink(url)}`);
+
+ return {
+ content: [{ type: 'text', text: lines.join('\n') }],
+ structuredContent: {
+ ok: hard.length === 0,
+ service: entry.name,
+ resource: url,
+ method: entry.method,
+ free: !rail,
+ recipient: rail?.pay_to ?? null,
+ amount_usd: priceUsd,
+ amount_atomics: rail?.amount_atomics ?? '0',
+ token,
+ asset: rail?.asset ?? null,
+ network: rail?.network ?? null,
+ from: wallet?.provisioned ? wallet.address : null,
+ balance_usdc: wallet?.balances?.usdc ?? null,
+ per_call_limit_usd: perCallLimit,
+ spend_enabled: spendEnabled,
+ blockers: blockers.map(({ code, message }) => ({ code, message })),
+ ...(!auth.userId || !spendEnabled ? { pay_link: payLink(url) } : {}),
+ },
+ ...(hard.length ? { isError: true } : {}),
+ };
+ },
+ };
+}
+
+function buildPayTool(entry) {
+ return {
+ name: entry.name,
+ title: entry.title,
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
+ description: `[$${entry.priceUsd} USDC per call] ${entry.description} Settles automatically from your three.ws agent wallet. Call ${quoteToolName(entry)} first and show the user its result.`,
+ inputSchema: entry.inputSchema,
+ async handler(args, auth) {
+ await enforce(limits.mcpAgentPay, auth);
+ const url = serviceUrl(entry, args);
+
+ if (!resolveSpendEnabled() || !auth.userId) {
+ return {
+ content: [
+ {
+ type: 'text',
+ text:
+ (auth.userId ? 'Autonomous spending is not enabled on this server yet. ' : 'Sign in to pay from your wallet. ') +
+ `You can complete this payment manually: ${payLink(url)}`,
+ },
+ ],
+ structuredContent: {
+ paid: false,
+ reason: auth.userId ? 'spend_disabled' : 'auth_required',
+ resource: url,
+ pay_link: payLink(url),
+ },
+ };
+ }
+
+ if (!hasScope(auth.scope, 'wallet:write')) return scopeRequired('wallet:write');
+
+ const unsigned = await agreementRequired(auth.userId, url);
+ if (unsigned) return unsigned;
+
+ try {
+ const res = await payExternalX402({
+ userId: auth.userId,
+ url,
+ method: entry.method,
+ body: entry.method === 'POST' ? args : undefined,
+ maxUsd: entry.priceUsd,
+ });
+ return {
+ content: [{ type: 'text', text: `Paid ${entry.title} from ${res.payer}. Result returned below.` }],
+ structuredContent: {
+ paid: true,
+ payer: res.payer,
+ resource: url,
+ result: res.result,
+ receipt: res.receipt,
+ },
+ };
+ } catch (err) {
+ const friendly = {
+ spend_disabled: 'Autonomous spending is disabled on this server.',
+ auth_required: 'Sign in to pay from your wallet.',
+ no_wallet: 'No agent wallet found for your account. Create one on three.ws.',
+ no_solana_wallet: 'Your agent has no Solana wallet provisioned.',
+ invalid_url: 'That resource URL is not a permitted public https endpoint.',
+ blocked_url: 'That resource URL resolves to a non-public address and was blocked.',
+ };
+ const msg = friendly[err.code] || `Payment failed: ${err.message}`;
+ return {
+ content: [{ type: 'text', text: msg }],
+ structuredContent: { paid: false, reason: err.code || 'error', resource: url, pay_link: payLink(url) },
+ isError: true,
+ };
+ }
+ },
+ };
+}
+
+export const namedServiceToolDefs = registry.tools.flatMap((entry) => [buildQuoteTool(entry), buildPayTool(entry)]);
diff --git a/api/_mcpagent/tools.js b/api/_mcpagent/tools.js
index d9c1aecfa..6a34d9e9e 100644
--- a/api/_mcpagent/tools.js
+++ b/api/_mcpagent/tools.js
@@ -52,7 +52,7 @@ function rpcError(code, message, data) {
return e;
}
-async function enforce(limiter, auth) {
+export async function enforce(limiter, auth) {
const rl = await limiter(auth.userId || auth.rateKey || 'anon');
if (!rl.success) {
throw rpcError(-32000, 'rate_limited', {
@@ -61,7 +61,7 @@ async function enforce(limiter, auth) {
}
}
-function payLink(resource) {
+export function payLink(resource) {
const u = new URL(`${env.APP_ORIGIN}/pay`);
u.searchParams.set('resource', resource);
return u.toString();
@@ -80,7 +80,7 @@ function signInRequired(text) {
// Real funds only move for an account that signed the current real-funds
// agreements. Returns null when the caller may proceed, otherwise a designed
// tool result. A database failure fails closed: nothing moves unverified.
-async function agreementRequired(userId, resource) {
+export async function agreementRequired(userId, resource) {
let signature;
try {
signature = await currentSignatureFor(userId);
@@ -117,7 +117,7 @@ async function agreementRequired(userId, resource) {
// the null-userId x402 path gets the friendly signInRequired() message first,
// and an authenticated-but-under-scoped token gets a clear, designed error
// rather than a bare JSON-RPC code.
-function scopeRequired(scope) {
+export function scopeRequired(scope) {
return {
content: [
{
@@ -181,14 +181,14 @@ async function requestDevnetAirdrop(address) {
}
}
-function chainLabel(network) {
+export function chainLabel(network) {
if (typeof network !== 'string') return 'unknown chain';
if (network.startsWith('solana')) return `Solana (${network})`;
if (network === 'eip155:8453' || network === 'base') return `Base (${network})`;
return network;
}
-function quoteRefusal(resource, reason, text, extra = {}) {
+export function quoteRefusal(resource, reason, text, extra = {}) {
return {
content: [{ type: 'text', text: `${text} Nothing was paid.` }],
structuredContent: { ok: false, reason, resource, ...extra },
@@ -201,7 +201,7 @@ function quoteRefusal(resource, reason, text, extra = {}) {
// fails and no preview id is issued for a payment that cannot happen. A signed-
// out caller or a server with spend off is not a hard blocker: pay_and_call
// answers both with the manual pay link, which the quote already carries.
-function payBlockers({ auth, spendEnabled, wallet, priceUsd, perCallLimit }) {
+export function payBlockers({ auth, spendEnabled, wallet, priceUsd, perCallLimit }) {
if (!auth.userId) {
return [{ code: 'auth_required', hard: false, message: 'Sign in to three.ws to pay from your agent wallet; until then use the pay link.' }];
}
diff --git a/packages/mcp-policy/src/table.js b/packages/mcp-policy/src/table.js
index a93f28f36..82082f0d5 100644
--- a/packages/mcp-policy/src/table.js
+++ b/packages/mcp-policy/src/table.js
@@ -238,6 +238,44 @@ export const POLICY = {
pay_quote: r('x402'),
pay_and_call: f('x402', 'confirm_payment', 'pay_quote', ['resource_url']),
monetize_endpoint: w('x402'),
+ // Named commerce tools (order 521, api/_mcpagent/named-services-tools.js),
+ // generated from packages/x402-mcp/src/tools.json. Each financial tool is
+ // gated on its OWN _quote preview tool, so a quote_id from one service's
+ // quote can never unlock a different service's payment.
+ weather_forecast_quote: r('x402'),
+ weather_forecast: f('x402', 'confirm_payment', 'weather_forecast_quote'),
+ weather_go_no_go_quote: r('x402'),
+ weather_go_no_go: f('x402', 'confirm_payment', 'weather_go_no_go_quote'),
+ carbon_now_quote: r('x402'),
+ carbon_now: f('x402', 'confirm_payment', 'carbon_now_quote'),
+ carbon_best_window_quote: r('x402'),
+ carbon_best_window: f('x402', 'confirm_payment', 'carbon_best_window_quote'),
+ domain_rdap_check_quote: r('x402'),
+ domain_rdap_check: f('x402', 'confirm_payment', 'domain_rdap_check_quote'),
+ domain_rdap_check_bulk_quote: r('x402'),
+ domain_rdap_check_bulk: f('x402', 'confirm_payment', 'domain_rdap_check_bulk_quote'),
+ research_search_quote: r('x402'),
+ research_search: f('x402', 'confirm_payment', 'research_search_quote'),
+ research_paper_quote: r('x402'),
+ research_paper: f('x402', 'confirm_payment', 'research_paper_quote'),
+ research_bibliography_quote: r('x402'),
+ research_bibliography: f('x402', 'confirm_payment', 'research_bibliography_quote'),
+ book_search_quote: r('x402'),
+ book_search: f('x402', 'confirm_payment', 'book_search_quote'),
+ book_read_quote: r('x402'),
+ book_read: f('x402', 'confirm_payment', 'book_read_quote'),
+ news_wire_search_quote: r('x402'),
+ news_wire_search: f('x402', 'confirm_payment', 'news_wire_search_quote'),
+ news_wire_poll_quote: r('x402'),
+ news_wire_poll: f('x402', 'confirm_payment', 'news_wire_poll_quote'),
+ transit_plan_quote: r('x402'),
+ transit_plan: f('x402', 'confirm_payment', 'transit_plan_quote'),
+ transit_delays_quote: r('x402'),
+ transit_delays: f('x402', 'confirm_payment', 'transit_delays_quote'),
+ places_search_quote: r('x402'),
+ places_search: f('x402', 'confirm_payment', 'places_search_quote'),
+ places_detail_quote: r('x402'),
+ places_detail: f('x402', 'confirm_payment', 'places_detail_quote'),
// Solana trading (api/_mcpagent/trading-tools.js over the shared registry
// api/_lib/trading-tools/registry.js). swap_execute verifies its own signed,
// single-use quote_id and re-prices it before signing.
@@ -753,6 +791,29 @@ export const POLICY = {
find_services: r('x402'),
inspect_endpoint: r('x402'),
pay_and_call: f('x402', 'confirm_payment', 'inspect_endpoint', ['url', 'method']),
+ spending_report: r('x402'),
+ // Named commerce tools (order 521, packages/x402-mcp/src/tools/named-services.js).
+ // The stdio package enforces its own confirm gate inline (config.js
+ // REQUIRE_CONFIRM via lib/pay-core.js), not this table's preview/confirm
+ // flow, so each is listed read/write only for the skill document and the
+ // settings page; its financial tier is unused by the stdio runtime.
+ weather_forecast: w('x402'),
+ weather_go_no_go: w('x402'),
+ carbon_now: w('x402'),
+ carbon_best_window: w('x402'),
+ domain_rdap_check: w('x402'),
+ domain_rdap_check_bulk: w('x402'),
+ research_search: w('x402'),
+ research_paper: w('x402'),
+ research_bibliography: w('x402'),
+ book_search: w('x402'),
+ book_read: w('x402'),
+ news_wire_search: w('x402'),
+ news_wire_poll: w('x402'),
+ transit_plan: w('x402'),
+ transit_delays: w('x402'),
+ places_search: w('x402'),
+ places_detail: w('x402'),
},
};
diff --git a/tests/api/mcp-agent-catalog.test.js b/tests/api/mcp-agent-catalog.test.js
index 12013933d..30bd5b171 100644
--- a/tests/api/mcp-agent-catalog.test.js
+++ b/tests/api/mcp-agent-catalog.test.js
@@ -127,6 +127,49 @@ describe('agent-wallet MCP catalog', () => {
'dca_create',
'dca_list',
'dca_cancel',
+ // Free-to-play event markets (api/_mcpagent/event-markets-tools.js, event-market-forecast-tools.js)
+ 'event_markets_list',
+ 'event_market',
+ 'event_market_pick',
+ 'event_market_analyze',
+ 'event_market_forecasters',
+ 'event_market_agent_pick',
+ // Named commerce tools, hosted mirror of the x402-mcp stdio package's
+ // fixed-endpoint tools (api/_mcpagent/named-services-tools.js)
+ 'weather_forecast_quote',
+ 'weather_forecast',
+ 'weather_go_no_go_quote',
+ 'weather_go_no_go',
+ 'carbon_now_quote',
+ 'carbon_now',
+ 'carbon_best_window_quote',
+ 'carbon_best_window',
+ 'domain_rdap_check_quote',
+ 'domain_rdap_check',
+ 'domain_rdap_check_bulk_quote',
+ 'domain_rdap_check_bulk',
+ 'research_search_quote',
+ 'research_search',
+ 'research_paper_quote',
+ 'research_paper',
+ 'research_bibliography_quote',
+ 'research_bibliography',
+ 'book_search_quote',
+ 'book_search',
+ 'book_read_quote',
+ 'book_read',
+ 'news_wire_search_quote',
+ 'news_wire_search',
+ 'news_wire_poll_quote',
+ 'news_wire_poll',
+ 'transit_plan_quote',
+ 'transit_plan',
+ 'transit_delays_quote',
+ 'transit_delays',
+ 'places_search_quote',
+ 'places_search',
+ 'places_detail_quote',
+ 'places_detail',
]);
});
diff --git a/tests/mcp-remote-annotations.test.js b/tests/mcp-remote-annotations.test.js
index 6cd8c7f8a..5d79889c4 100644
--- a/tests/mcp-remote-annotations.test.js
+++ b/tests/mcp-remote-annotations.test.js
@@ -118,6 +118,14 @@ const DESTRUCTIVE_TOOLS = new Set([
'agent_mail_create', 'agent_mail_send', 'agent_mail_reply',
'agent_send', 'agent_buy_confirm',
'swap_execute',
+ // Named commerce tools (order 521, api/_mcpagent/named-services-tools.js):
+ // each pays a fixed three.ws x402 service from the agent wallet, gated on
+ // its own <name>_quote preview (the quote tools themselves stay read-only
+ // and are not in this set).
+ 'weather_forecast', 'weather_go_no_go', 'carbon_now', 'carbon_best_window',
+ 'domain_rdap_check', 'domain_rdap_check_bulk', 'research_search', 'research_paper', 'research_bibliography',
+ 'book_search', 'book_read', 'news_wire_search', 'news_wire_poll',
+ 'transit_plan', 'transit_delays', 'places_search', 'places_detail',
]);
// Destructive tools the policy deliberately leaves in the write tier (on by