run_quick_test
Start a low-cost AI-visibility snapshot for a domain. Runs asynchronously with immediate return; poll results with get_quick_test.
Instructions
Start a "quick test" — a low-cost (1 credit) AI-visibility snapshot for a domain. Returns immediately; the test runs asynchronously. Use get_quick_test to poll. If your API key is scoped to a project, websiteId must match that project.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes | Root domain, e.g. "example.com" | |
| brandName | No | Brand name (optional — auto-detected if omitted) | |
| country | No | ISO-2 country code (e.g. "US") | |
| engines | No | AI engines to query (e.g. ["chatgpt", "perplexity"]). Defaults to all available. | |
| websiteId | No | Optional — link the test to an existing project. |
Implementation Reference
- src/tools/quickTest.js:25-25 (handler)The handler that executes the 'run_quick_test' tool logic. It sends a POST request to '/quick-test' with the input parameters (domain, brandName, country, engines, websiteId).
handler: async (input) => api.post('/quick-test', input), - src/tools/quickTest.js:10-24 (schema)The input schema for 'run_quick_test'. Requires 'domain' string, with optional properties: brandName, country, engines (array of strings), and websiteId.
inputSchema: { type: 'object', properties: { domain: { type: 'string', description: 'Root domain, e.g. "example.com"' }, brandName: { type: 'string', description: 'Brand name (optional — auto-detected if omitted)' }, country: { type: 'string', description: 'ISO-2 country code (e.g. "US")' }, engines: { type: 'array', items: { type: 'string' }, description: 'AI engines to query (e.g. ["chatgpt", "perplexity"]). Defaults to all available.', }, websiteId: { type: 'string', description: 'Optional — link the test to an existing project.' }, }, required: ['domain'], }, - src/index.js:31-39 (registration)The tool is registered as part of the ALL_TOOLS array by spreading quickTestTools, and looked up by name via the toolByName Map at line 41.
const ALL_TOOLS = [ ...projectTools, ...keywordTools, ...reportTools, ...quickTestTools, ...keywordResearchTools, ...competitorTools, ...opportunityTools, ]; - src/index.js:56-64 (registration)The ListToolsRequestSchema handler exposes all tools (including run_quick_test) to the MCP client by stripping the handler from each tool definition.
server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: ALL_TOOLS.map(({ name, description, inputSchema }) => ({ name, description, inputSchema, })), }; }); - src/index.js:67-96 (registration)The CallToolRequestSchema handler dispatches tool calls by name, invoking tool.handler(args) — this is the runtime dispatch that executes run_quick_test.
server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args = {} } = request.params; const tool = toolByName.get(name); if (!tool) { return { isError: true, content: [{ type: 'text', text: `Unknown tool: ${name}` }], }; } try { const result = await tool.handler(args); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; } catch (err) { // Surface the SurfRank error message verbatim so the model can react // (e.g. "insufficient credits" → tell the user to top up). const message = err?.message || 'Unknown error'; return { isError: true, content: [{ type: 'text', text: message }], }; } });