Skip to main content
Glama

search_documentation

Find VeChain documentation, API references, and code examples by searching across official guides and resources to answer development questions.

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 VeChain 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
NameRequiredDescriptionDefault
queryYesThe search query string

Implementation Reference

  • The callback function that executes the tool logic. It proxies the search query to the VeChain documentation MCP server by calling its 'searchDocumentation' tool.
    callback: async ({ query }: { query: string }) => { try { const vechainDocsMcpClient = await createVechainDocsMcpClient(); const response = await vechainDocsMcpClient.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 account", reason: String((err as Error)?.message ?? err), }, null, 2 ), }, ], }; } }
  • Zod input schema definition for the tool, specifying the 'query' parameter.
    inputSchema: { query: z.string().describe("The search query string"), },
  • src/server.ts:74-92 (registration)
    Registers all tools from the vechainTools array (including 'search_documentation') with the MCP server using their predefined properties and callbacks.
    for (const t of vechainTools) { server.registerTool( t.name, { title: t.name, description: t.description, inputSchema: t.inputSchema }, async (args) => { const result = await t.callback(args); return { content: result.content.map(item => ({ ...item, type: "text" as const })) }; } ); }
  • Helper function used by the handler to create an MCP client connected to the VeChain documentation server for proxying the search request.
    export async function createVechainDocsMcpClient() { try { const vechainDocsMcpClient = await createGitbookMcpClient(vechainConfig.mcpClient.vechainDocsUrl); return vechainDocsMcpClient } catch (err) { console.error("Error creating VeChain Docs MCP Client:", err); throw err; } }
  • src/tools.ts:30-72 (registration)
    Tool object definition in vechainTools array, which includes name, schema, description, and handler reference for registration.
    { name: "search_documentation", title: "Search VeChain 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 VeChain 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 vechainDocsMcpClient = await createVechainDocsMcpClient(); const response = await vechainDocsMcpClient.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 account", reason: String((err as Error)?.message ?? err), }, null, 2 ), }, ], }; } } },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/leandrogavidia/vechain-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server