Skip to main content
Glama

search_docs

Search Astro documentation to find relevant information for Astro-related tasks. This tool enables AI assistants to retrieve specific content from the Astro docs for accurate user support.

Instructions

Search Astro documentation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch term to find in Astro documentation

Implementation Reference

  • Handler for the 'search_docs' tool within the CallToolRequestSchema request handler. It extracts the query, calls searchDocs helper, and returns formatted search results or no results message.
    case "search_docs": { const args = request.params.arguments || {}; const query = args.query ? String(args.query) : ""; if (!query) { throw new Error("Search query is required"); } const results = searchDocs(query); if (results.length === 0) { return { content: [{ type: "text", text: `No documentation found for query: "${query}"` }] }; } return { content: [ { type: "text", text: `Found ${results.length} documentation sections for "${query}":\n\n` + results.map(section => `- ${section.title}: ${section.content.substring(0, 100)}... (URI: astro-docs:///${section.id})` ).join('\n\n') } ] }; }
  • Input schema definition for the 'search_docs' tool, specifying a required 'query' string parameter.
    inputSchema: { type: "object", properties: { query: { type: "string", description: "Search term to find in Astro documentation" } }, required: ["query"] }
  • src/index.ts:640-659 (registration)
    Registration of the 'search_docs' tool via the ListToolsRequestSchema handler, which lists available tools including name, description, and schema.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ { name: "search_docs", description: "Search Astro documentation", inputSchema: { type: "object", properties: { query: { type: "string", description: "Search term to find in Astro documentation" } }, required: ["query"] } } ] }; });
  • Helper function that performs the actual search over astroDocsSections by filtering sections matching the query in title, content, or category.
    query = query.toLowerCase(); return Object.values(astroDocsSections).filter(section => { return section.title.toLowerCase().includes(query) || section.content.toLowerCase().includes(query) || section.category.toLowerCase().includes(query); }); }

Other Tools

Related Tools

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/dreyfus92/astro-docs-mcp'

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