gst_intelligence
Retrieve GST registration details and filing intelligence for Indian businesses using a 15-character GSTIN number to verify compliance and financial status.
Instructions
Get GST registration details and filing intelligence for a GSTIN. Cost: $0.005 USDC. Service: papertrail.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gstin | Yes | 15-character GSTIN |
Implementation Reference
- src/index.ts:166-223 (handler)The tool 'gst_intelligence' (along with all other tools) is handled dynamically in the CallToolRequestSchema request handler, which fetches tools from a remote registry and executes them via callTool.
server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; let registry: Registry; try { registry = await fetchRegistry(); } catch (error) { return { content: [ { type: "text", text: JSON.stringify({ error: "Failed to fetch tool registry", detail: String(error) }), }, ], }; } const tool = registry.tools.find((t) => t.name === name); if (!tool) { return { content: [ { type: "text", text: JSON.stringify({ error: `Tool '${name}' not found`, available_tools: registry.tools.map((t) => t.name), }), }, ], }; } try { const result = await callTool(tool, args as Record<string, unknown>); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text", text: JSON.stringify({ error: "Tool call failed", tool: name, service: tool.service, detail: String(error), }), }, ], }; } }); - src/index.ts:88-132 (helper)The callTool function performs the actual HTTP request to the endpoint associated with the selected tool.
async function callTool( tool: RegistryTool, args: Record<string, unknown> ): Promise<unknown> { const headers: Record<string, string> = { "Content-Type": "application/json", }; if (X_PAYMENT_HEADER) { headers["X-PAYMENT"] = X_PAYMENT_HEADER; } if (DEV_MODE) { headers["X-Dev-Mode"] = "true"; } const response = await fetch(tool.endpoint, { method: tool.method, headers, body: JSON.stringify(args), }); if (response.status === 402) { const detail = await response.json().catch(() => ({})); return { error: "Payment Required", amount_usdc: tool.cost_usdc, service: tool.service, instructions: "Set X_PAYMENT_HEADER env var with a valid x402 payment proof, or set DEV_MODE=true for testing.", detail, }; } if (!response.ok) { const text = await response.text().catch(() => "Unknown error"); return { error: `HTTP ${response.status}`, service: tool.service, detail: text, }; } return await response.json(); }