Skip to main content
Glama

get_all_docs

Retrieve Next.js documentation URLs to help AI agents fetch relevant content for answering questions about Next.js features, errors, and development topics.

Instructions

Provide all Next.js documentation URLs for AI agents.

Auto-trigger guidance (for clients):

  • Run when the user asks about 'Next.js', 'Nextjs', 'Next', or mentions topics like 'App Router', 'Pages Router', 'Route Handlers', 'data fetching', 'deployment', 'turbopack', 'Vercel'.

  • Run when the user reports errors containing keywords like 'Next.js error', 'build error', 'routing error', 'hydration error', 'module not found', 'next.config.js', 'middleware', 'Image', 'Link', 'Route Handler'.

  • Run when an active file path suggests a Next.js app, e.g. 'next.config.js', 'app/', 'pages/', 'middleware.ts/js', or imports starting with 'next/'.

Post-call agent instructions (MUST DO):

  • After receiving the list, FETCH the content of the top relevant URLs (at least the first 3–5) to ground answers in the actual docs.

  • Use standard HTTP GET with a 10s timeout, follow redirects, and limit concurrency to 3 to be polite.

  • Prefer pages whose title/URL matches the user's query or error message; summarize only after fetching.

  • If fetching fails, try the next candidate URL and report which ones were fetched. This tool returns a comprehensive list so the agent can pick and fetch the most relevant docs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contextNoOptional user query, error message, or code snippet used by the client to decide invocation
filePathNoOptional current file path used by the client to decide invocation
statusYesCosmetic flag to ensure clients log arguments/header (e.g., 'executing')executing

Implementation Reference

  • The primary handler function for the 'get_all_docs' tool. It processes input arguments, constructs a header with context/file/status info, aggregates all documentation entries from NEXTJS_DOCS_DATABASE, formats them into a numbered list with categories, and returns a structured text response optimized for Claude AI consumption.
    private async getAllDocsForClaude(args?: { context?: string; filePath?: string; status?: string }) { const header: string[] = []; header.push("✅ Next.js Docs MCP executed successfully."); if (args?.context) { header.push(`Context: ${args.context}`); } if (args?.filePath) { header.push(`Active file: ${args.filePath}`); } if (args?.status) { header.push(`Status: ${args.status}`); } const allDocs: Array<{title: string, url: string, description: string, category: string}> = []; // データベースから全ドキュメントを取得 Object.entries(NEXTJS_DOCS_DATABASE).forEach(([category, docs]) => { docs.forEach((doc: any) => { allDocs.push({ title: doc.title, url: doc.url, description: doc.description, category: category }); }); }); // Claudeが理解しやすい形式で出力 const formattedDocs = allDocs.map((doc, index) => `${index + 1}. **${doc.title}**\n 📁 Category: ${doc.category}\n 🔗 ${doc.url}\n 📝 ${doc.description}\n` ).join('\n'); return { content: [ { type: "text", text: header.join("\n") + `\n\n📚 **Next.js Documentation - All Available Documents**\n\n` + `Total documents: ${allDocs.length}\n\n` + `以下は全てのNext.jsドキュメントURLです。あなたのクエリに関連するドキュメントをこれらの中から選んでください:\n\n` + `${formattedDocs}\n\n` + `---\n` + `**使い方:**\n` + `これらのドキュメントの中から、あなたの質問や問題に関連するものを選んで、該当するURLを参照してください。`, }, ], }; }
  • src/index.ts:225-250 (registration)
    Tool registration in the ListToolsRequestSchema handler, defining the name, description, and input schema for 'get_all_docs'.
    tools: [ { name: "get_all_docs", description: "Provide all Next.js documentation URLs for AI agents.\n\nAuto-trigger guidance (for clients):\n- Run when the user asks about 'Next.js', 'Nextjs', 'Next', or mentions topics like 'App Router', 'Pages Router', 'Route Handlers', 'data fetching', 'deployment', 'turbopack', 'Vercel'.\n- Run when the user reports errors containing keywords like 'Next.js error', 'build error', 'routing error', 'hydration error', 'module not found', 'next.config.js', 'middleware', 'Image', 'Link', 'Route Handler'.\n- Run when an active file path suggests a Next.js app, e.g. 'next.config.js', 'app/**', 'pages/**', 'middleware.ts/js', or imports starting with 'next/'.\n\nPost-call agent instructions (MUST DO):\n- After receiving the list, FETCH the content of the top relevant URLs (at least the first 3–5) to ground answers in the actual docs.\n- Use standard HTTP GET with a 10s timeout, follow redirects, and limit concurrency to 3 to be polite.\n- Prefer pages whose title/URL matches the user's query or error message; summarize only after fetching.\n- If fetching fails, try the next candidate URL and report which ones were fetched.\nThis tool returns a comprehensive list so the agent can pick and fetch the most relevant docs.", inputSchema: { type: "object", properties: { context: { type: "string", description: "Optional user query, error message, or code snippet used by the client to decide invocation", }, filePath: { type: "string", description: "Optional current file path used by the client to decide invocation", }, status: { type: "string", description: "Cosmetic flag to ensure clients log arguments/header (e.g., 'executing')", default: "executing", }, }, required: ["status"], }, }, ], };
  • Input schema definition for the 'get_all_docs' tool, specifying optional context, filePath, and required status parameters.
    inputSchema: { type: "object", properties: { context: { type: "string", description: "Optional user query, error message, or code snippet used by the client to decide invocation", }, filePath: { type: "string", description: "Optional current file path used by the client to decide invocation", }, status: { type: "string", description: "Cosmetic flag to ensure clients log arguments/header (e.g., 'executing')", default: "executing", }, }, required: ["status"], },
  • src/index.ts:258-260 (registration)
    Dispatch case in the CallToolRequestSchema handler that routes calls to 'get_all_docs' to the getAllDocsForClaude method.
    switch (name) { case "get_all_docs": return await this.getAllDocsForClaude(args as { context?: string; filePath?: string });
Install Server

Other 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/nanameru/Next.js-Docs-MCP'

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