Skip to main content
Glama

tanstack_doc

Fetch the full content of a TanStack documentation page for any library and specific path.

Instructions

Fetch the full content of a specific TanStack documentation page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
libraryYesLibrary ID (e.g. query, router, table, start, form, virtual)
pathYesDocumentation path (e.g. framework/react/overview, guide/server-functions)
docsVersionNoDocs version (default: latest)

Implementation Reference

  • Tool handler for 'tanstack_doc'. Builds CLI args from library, path, and optional docsVersion, then runs the CLI and returns JSON-parsed result.
      async ({ library, path, docsVersion }) => {
        const args = ["doc", library, path, "--json"];
        if (docsVersion) args.push("--docs-version", docsVersion);
    
        const { stdout } = await runCli(args);
        return jsonResult(parseJsonOutput(stdout));
      },
    );
  • Schema definition for 'tanstack_doc'. Defines description and input parameters: library (string), path (string), docsVersion (optional string).
    "tanstack_doc",
    "Fetch the full content of a specific TanStack documentation page",
    {
      library: z
        .string()
        .describe("Library ID (e.g. query, router, table, start, form, virtual)"),
      path: z
        .string()
        .describe(
          "Documentation path (e.g. framework/react/overview, guide/server-functions)",
        ),
      docsVersion: z
        .string()
        .optional()
        .describe("Docs version (default: latest)"),
    },
  • src/index.ts:213-237 (registration)
    Registration of the 'tanstack_doc' tool on the MCP server via server.tool() with name, description, schema, and handler.
    server.tool(
      "tanstack_doc",
      "Fetch the full content of a specific TanStack documentation page",
      {
        library: z
          .string()
          .describe("Library ID (e.g. query, router, table, start, form, virtual)"),
        path: z
          .string()
          .describe(
            "Documentation path (e.g. framework/react/overview, guide/server-functions)",
          ),
        docsVersion: z
          .string()
          .optional()
          .describe("Docs version (default: latest)"),
      },
      async ({ library, path, docsVersion }) => {
        const args = ["doc", library, path, "--json"];
        if (docsVersion) args.push("--docs-version", docsVersion);
    
        const { stdout } = await runCli(args);
        return jsonResult(parseJsonOutput(stdout));
      },
    );
  • Helper function parseJsonOutput - parses CLI stdout by finding first JSON object/array start and parsing it.
    function parseJsonOutput(stdout: string): unknown {
      // The CLI may print warnings before the JSON blob – find the first { or [
      const jsonStart = stdout.search(/[\[{]/);
      if (jsonStart === -1) {
        throw new Error(`CLI returned non-JSON output:\n${stdout}`);
      }
      return JSON.parse(stdout.slice(jsonStart));
    }
  • Helper function jsonResult - wraps data as a text content result with JSON stringification.
    function jsonResult(data: unknown) {
      return textResult(JSON.stringify(data, null, 2));
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Without annotations, the description relies on implying a read operation. 'Fetch full content' suggests no destructive behavior, but no explicit disclosure of potential side effects or prerequisites. Adequate but minimal.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with no unnecessary words. It effectively communicates the tool's purpose in a concise manner.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple fetch tool with well-described parameters, the description is sufficient. However, it lacks details about the output format (e.g., markdown, HTML), which would improve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage with clear parameter meanings. The description adds no extra semantics beyond 'full content' context. Baseline score is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Fetch' and the resource 'full content of a specific TanStack documentation page'. It is specific and distinguishes from siblings like 'tanstack_search_docs' which is for search.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use (to fetch full doc content) but does not explicitly state when not to use or mention alternatives. It is adequate for a straightforward fetch tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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/zPeppOz/tanstack-mcp'

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