search_documentation
Search Marinade Finance documentation to find information, code examples, API references, and guides with direct links to relevant pages.
Instructions
Search across the documentation to find relevant information, code examples, API references, and guides. Use this tool when you need to answer questions about Marinade Finance Docs, find specific documentation, understand how features work, or locate implementation details. The search returns contextual content with titles and direct links to the documentation pages.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The search query string |
Implementation Reference
- src/tools.ts:54-89 (handler)The handler function that executes the tool: creates a Marinade Finance Docs MCP client and invokes its 'searchDocumentation' tool with the user query, returning the JSON response or handling errors.callback: async ({ query }: { query: string }) => { try { const marinadeFinanceDocsMcpClient = await createMarinadeFinanceDocsMcpClient(); const response = await marinadeFinanceDocsMcpClient.client.callTool({ name: "searchDocumentation", arguments: { query } }) return { content: [ { type: "text", text: JSON.stringify(response, null, 2), }, ], }; } catch (err) { const isAbort = (err as Error)?.name === "AbortError"; return { content: [ { type: "text", text: JSON.stringify( { error: isAbort ? "Request timed out" : "Failed to fetch documentation", reason: String((err as Error)?.message ?? err), }, null, 2 ), }, ], }; } } },
- src/tools.ts:51-53 (schema)Zod input schema validating the 'query' parameter as a string.inputSchema: { query: z.string().describe("The search query string"), },
- src/tools.ts:48-89 (registration)Tool object definition with name, title, description, input schema, and handler callback, included in the publicTools array which is exported and registered in the MCP server.name: "search_documentation", title: "Search Marinade Finance Documentation", description: "Search across the documentation to find relevant information, code examples, API references, and guides. Use this tool when you need to answer questions about Marinade Finance Docs, find specific documentation, understand how features work, or locate implementation details. The search returns contextual content with titles and direct links to the documentation pages.", inputSchema: { query: z.string().describe("The search query string"), }, callback: async ({ query }: { query: string }) => { try { const marinadeFinanceDocsMcpClient = await createMarinadeFinanceDocsMcpClient(); const response = await marinadeFinanceDocsMcpClient.client.callTool({ name: "searchDocumentation", arguments: { query } }) return { content: [ { type: "text", text: JSON.stringify(response, null, 2), }, ], }; } catch (err) { const isAbort = (err as Error)?.name === "AbortError"; return { content: [ { type: "text", text: JSON.stringify( { error: isAbort ? "Request timed out" : "Failed to fetch documentation", reason: String((err as Error)?.message ?? err), }, null, 2 ), }, ], }; } } },
- src/client.ts:40-51 (helper)Helper function to create and connect the MCP client for the Marinade Finance documentation service, invoked within the tool handler.export async function createMarinadeFinanceDocsMcpClient(): Promise<{ client: Client; listTools(): Promise<any[]>; }> { try { const marinadeFinanceDocsMcpClient = await createGitbookMcpClient(marinadeFinanceConfig.mcpClient.marinadeFinanceDocsUrl); return marinadeFinanceDocsMcpClient } catch (err) { McpLogger.error("Error creating Marinade Finance Docs MCP Client:", String(err)); throw err; } }