insumer_verify_domain
Verify a merchant's domain ownership after placing a verification token via DNS TXT record, HTML meta tag, or file upload. The server automatically checks all three methods. Owner only, rate limited to 5 attempts per hour.
Instructions
Verify domain ownership for a merchant. Call this after placing the verification token (from insumer_request_domain_verification) via DNS TXT record, HTML meta tag, or file upload. The server checks all three methods automatically. Rate limited to 5 attempts per hour. Owner only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Merchant ID |
Implementation Reference
- src/index.ts:683-696 (registration)Registration of the 'insumer_verify_domain' tool on the MCP server. Defines tool name, description, Zod schema (accepts 'id' as a string merchant ID), and handler that makes a PUT request to the domain-verification API endpoint.
server.tool( "insumer_verify_domain", "Verify domain ownership for a merchant. Call this after placing the verification token (from insumer_request_domain_verification) via DNS TXT record, HTML meta tag, or file upload. The server checks all three methods automatically. Rate limited to 5 attempts per hour. Owner only.", { id: z.string().describe("Merchant ID"), }, async (args) => { const result = await apiCall( "PUT", `/merchants/${encodeURIComponent(args.id)}/domain-verification` ); return formatResult(result); } ); - src/index.ts:689-695 (handler)The handler function for the 'insumer_verify_domain' tool. Calls apiCall with PUT method to /merchants/{id}/domain-verification and formats the result.
async (args) => { const result = await apiCall( "PUT", `/merchants/${encodeURIComponent(args.id)}/domain-verification` ); return formatResult(result); } - src/index.ts:17-40 (helper)The apiCall helper function used by the handler to make authenticated HTTP requests to the Insumer API.
async function apiCall( method: string, path: string, body?: Record<string, unknown> ): Promise<{ ok: boolean; data?: unknown; error?: unknown; meta?: unknown }> { if (!apiKey) { return { ok: false, error: "INSUMER_API_KEY is not set. Call the insumer_setup tool to generate a free API key instantly, then add it to your MCP config as INSUMER_API_KEY and restart." }; } const url = `${API_BASE}${path}`; const res = await fetch(url, { method, headers: { "Content-Type": "application/json", "X-API-Key": apiKey, }, body: body ? JSON.stringify(body) : undefined, }); return res.json() as Promise<{ ok: boolean; data?: unknown; error?: unknown; meta?: unknown; }>; } - src/index.ts:61-76 (helper)The formatResult helper function used by the handler to format API responses into MCP content blocks.
function formatResult(result: { ok: boolean; data?: unknown; error?: unknown; meta?: unknown; }) { if (result.ok) { return { content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }], }; } return { content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }], isError: true, }; } - src/index.ts:686-688 (schema)Zod input schema for the 'insumer_verify_domain' tool. Accepts a single 'id' field (string, merchant ID).
{ id: z.string().describe("Merchant ID"), },