Search Sanctions
search_sanctionsSearch across OFAC SDN, EU, UN, and UK sanctions lists by name, alias, address, country, or program. Returns relevance-ranked results at $0.009 per query.
Instructions
Full-text search across all sanctions entries. Search by name, alias, address, country, or program. Returns matching entries ranked by relevance. Cost: $0.009 per query. Source: OFAC SDN, EU, UN, UK lists.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | Yes | Search query (name, alias, address, country, etc.) | |
| limit | No | Maximum results (default 25) |
Implementation Reference
- src/tools/sanctions.ts:110-136 (handler)The async handler function for the 'search_sanctions' tool. Makes an API GET to /api/v1/sanctions/search with query 'q' and optional 'limit', then returns formatted results or an error message.
async ({ q, limit }) => { const res = await apiGet<SanctionsQueryResponse>( "/api/v1/sanctions/search", { q, limit: limit ?? 25 }, ); if (!res.ok) { return { content: [ { type: "text" as const, text: `API error (${res.status}): ${JSON.stringify(res.data)}`, }, ], isError: true, }; } const { count, data } = res.data; const warn = stalenessWarning(res); const summary = `${warn}Found ${count} sanctions result(s).`; const json = JSON.stringify(data, null, 2); return { content: [{ type: "text" as const, text: `${summary}\n\n${json}` }], }; }, - src/tools/sanctions.ts:99-108 (schema)Input schema for search_sanctions tool: 'q' (required string query) and 'limit' (optional integer 1-100, default 25).
inputSchema: { q: z.string().describe("Search query (name, alias, address, country, etc.)"), limit: z .number() .int() .min(1) .max(100) .optional() .describe("Maximum results (default 25)"), }, - src/tools/sanctions.ts:91-137 (registration)Registration of the 'search_sanctions' tool via server.registerTool() with its title, description, inputSchema, and handler.
server.registerTool( "search_sanctions", { title: "Search Sanctions", description: "Full-text search across all sanctions entries. Search by name, alias, address, " + "country, or program. Returns matching entries ranked by relevance. " + "Cost: $0.009 per query. Source: OFAC SDN, EU, UN, UK lists.", inputSchema: { q: z.string().describe("Search query (name, alias, address, country, etc.)"), limit: z .number() .int() .min(1) .max(100) .optional() .describe("Maximum results (default 25)"), }, }, async ({ q, limit }) => { const res = await apiGet<SanctionsQueryResponse>( "/api/v1/sanctions/search", { q, limit: limit ?? 25 }, ); if (!res.ok) { return { content: [ { type: "text" as const, text: `API error (${res.status}): ${JSON.stringify(res.data)}`, }, ], isError: true, }; } const { count, data } = res.data; const warn = stalenessWarning(res); const summary = `${warn}Found ${count} sanctions result(s).`; const json = JSON.stringify(data, null, 2); return { content: [{ type: "text" as const, text: `${summary}\n\n${json}` }], }; }, ); - src/index.ts:48-48 (registration)Top-level registration call: registerSanctionsTools(server) invoked from main index.ts, which registers all sanctions tools including search_sanctions.
registerSanctionsTools(server); - src/client.ts:44-76 (helper)The apiGet helper used by the handler to make the GET request to the Verilex API. Also the stalenessWarning helper used to format stale data warnings.
export async function apiGet<T = unknown>( path: string, params?: Record<string, string | number | undefined>, ): Promise<ApiResponse<T>> { const url = buildUrl(path, params); const headers: Record<string, string> = { Accept: "application/json", "User-Agent": "verilex-mcp-server/0.1.0", }; // Forward x402 payment token if present in env (for paid endpoints) const paymentToken = process.env.VERILEX_PAYMENT_TOKEN; if (paymentToken) { headers["X-Payment-Token"] = paymentToken; } const res = await fetch(url, { headers }); const data = (await res.json()) as T; const stale = res.headers.get("X-Data-Stale"); const lastUpdated = res.headers.get("X-Data-Last-Updated"); const ageSeconds = res.headers.get("X-Data-Age-Seconds"); return { ok: res.ok, status: res.status, data, stale: stale === "true", lastUpdated: lastUpdated ?? undefined, ageSeconds: ageSeconds ? Number(ageSeconds) : undefined, }; }