sodax_get_intent
Query a specific cross-chain intent using its intent hash. Returns details in JSON or markdown format.
Instructions
Look up a specific intent by its intent hash (different from transaction hash)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| intentHash | Yes | The intent hash to look up (66 character hex string starting with 0x) | |
| format | No | Response format: 'json' for raw data or 'markdown' for formatted text | markdown |
Implementation Reference
- src/tools/sodaxApi.ts:705-737 (handler)MCP tool handler for 'sodax_get_intent'. Registers the tool with Zod schema for intentHash (required) and format (optional, default markdown). Calls getIntent() service and formats response.
// Tool 19: Get Intent by Hash server.tool( "sodax_get_intent", "Look up a specific intent by its intent hash (different from transaction hash)", { intentHash: z.string() .describe("The intent hash to look up (66 character hex string starting with 0x)"), format: z.nativeEnum(ResponseFormat).optional().default(ResponseFormat.MARKDOWN) .describe("Response format: 'json' for raw data or 'markdown' for formatted text") }, READ_ONLY, async ({ intentHash, format }) => { try { const intent = await getIntent(intentHash); if (!intent) { return { content: [{ type: "text", text: `Intent not found: ${intentHash}` }] }; } return { content: [{ type: "text", text: `## Intent Details\n\n` + formatResponse(intent, format) }] }; } catch (error) { return { content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : "Unknown error"}` }], isError: true }; } } ); - src/services/sodaxApi.ts:478-492 (helper)Service function getIntent() that makes the actual HTTP GET /intent/{intentHash} API call to the SODAX API and returns the response data.
/** * Look up an intent by its intent hash (not tx hash) */ export async function getIntent(intentHash: string): Promise<unknown> { try { const response = await apiClient.get(`/intent/${intentHash}`); return response.data?.data || response.data || null; } catch (error) { if (axios.isAxiosError(error) && error.response?.status === 404) { return null; } console.error("Error fetching intent:", error); throw new Error("Failed to fetch intent from SODAX API"); } } - src/index.ts:44-48 (registration)Registration entry point: registerSodaxApiTools(server) is called when creating the MCP server, which registers all SODAX API tools including sodax_get_intent.
registerSodaxApiTools(server); await registerGitBookProxyTools(server); return server; } - API drift check schema mapping: defines GET /intent/:intentHash endpoint maps to tool 'sodax_get_intent', with params/requiredParams/responseFields for validation.
"GET /intent/:intentHash": { tool: "sodax_get_intent", params: ["intentHash"], requiredParams: ["intentHash"], responseFields: ["intentHash", "txHash", "logIndex", "chainId", "blockNumber", "open", "intent", "events"], }, - src/services/analytics.ts:41-41 (helper)Analytics configuration: maps sodax_get_intent to 'api' category for PostHog tracking.
sodax_get_intent: "api",