Skip to main content
Glama
xvantz

ts-docs-mcp

by xvantz

get_package_docs

Get accurate, version-specific API documentation for any npm package directly from source code, with function signatures, types, and exports.

Instructions

Get accurate, version-specific API documentation for any npm package.

WHEN TO USE THIS TOOL:

  • ALWAYS call this tool when the user asks about a library, package, or framework.

  • ALWAYS call this tool BEFORE writing code that uses an external npm dependency.

  • ALWAYS call this tool when you need to know function signatures, types, interfaces, classes, or exports from a package.

  • Call this tool when the user says things like: 'use zod', 'write with axios', 'how does fastify work', 'express route handler', 'prisma schema', 'lodash merge'.

  • Call this tool when a package version is mentioned: 'zod@3.23', 'express 4.18' — pass it as the 'version' parameter.

DO NOT rely on training data for package APIs — training data is months out of date. This tool fetches the EXACT version the user needs from the actual source code.

Supports:

  • Specific version: get_package_docs('zod', version='3.23.8')

  • Subpath exports: get_package_docs('zod', subpath='v4/classic')

  • Symbol search: get_package_docs('zod', query='transform')

Documentation is cached for 24 hours — repeated calls for the same package+version are instant.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoOptional — find a specific symbol within the package.
packageYesnpm package name, e.g. 'zod', 'express', '@prisma/client'
subpathNoOptional — subpath export entry, e.g. 'v4/classic' for zod/v4/classic.
versionNoOptional — exact version to fetch (e.g. '3.23.8'). Defaults to latest.
Behavior4/5

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

No annotations are provided, so the description carries the full behavioral disclosure burden. It discloses that docs are cached for 24 hours, that the tool fetches from actual source code, and implies it's a read-only fetch operation with no side effects. It could mention rate limits or network failure behavior, but the 24-hour caching and source-fetch behavior are meaningful transparency disclosures. The guidance not to trust training data further clarifies expected behavior.

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

Conciseness4/5

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

The description is well structured with clear sections (WHEN TO USE, DO NOT, Supports). It's longer than minimal but every line earns its place — the trigger phrases and usage examples are genuinely informative. The only minor critique is some redundancy between 'ALWAYS call this tool when the user asks about a library/package/framework' and subsequent bullet points, but overall it's efficient and front-loaded with the most important directive.

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?

This is a 4-parameter tool with no output schema, so the description carries responsibility for explaining both inputs and expected returns. It does an excellent job on inputs (usage patterns, trigger phrases, version handling) and mentions fetching from source code and caching, which implies the return is structured API documentation. It could explicitly state what the return value contains (e.g., signatures, examples) but the level of detail is strong for a documentation-fetch tool.

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?

Schema description coverage is 100%, so all 4 parameters are already documented in the input schema. The description adds value by showing concrete usage patterns (get_package_docs('zod', version='3.23.8'), subpath='v4/classic', query='transform') that go beyond the schema's bare definitions. This meets the baseline 3 for compensating beyond high schema coverage.

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 opens with a clear, specific statement: 'Get accurate, version-specific API documentation for any npm package.' It names the verb (get), resource (API documentation), and scope (version-specific, npm). The WHEN TO USE section reinforces purpose with concrete trigger examples ('use zod', 'express route handler'). No ambiguity about what this tool does.

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

Usage Guidelines5/5

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

This is exemplary. The description gives explicit when-to-use rules ('ALWAYS call this tool when the user asks about a library'), specific trigger phrases, and a direct warning to NOT rely on training data for package APIs — effectively indicating when this tool is authoritative over other sources. It also demonstrates usage patterns for version, subpath, and query parameters.

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/xvantz/ts-docs-mcp'

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