Skip to main content
Glama

Raw TypeScript declarations of a package

package_types

Retrieve the raw .d.ts type declarations for an npm package@version to get exact signatures, generics, overloads, and option-object shapes that summaries miss.

Instructions

Return the raw .d.ts declaration text for an npm package@version — the ground-truth type definitions. Use when you need exact signatures, generic parameters, overloads, or option-object shapes that a summary can't capture (e.g. the precise props of a component or the full options of a function). Defaults to the package's types entry; pass file (from list_type_files) to read a specific declaration file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNoSpecific .d.ts path to read (from list_type_files). Defaults to the types entry.
packageYesnpm package name.
versionNoVersion or dist-tag. Defaults to 'latest'.
maxCharsNoTruncate output (default 16000) to protect the context window.
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 burden. It clearly implies a read-only operation ('Return the raw .d.ts declaration text') and explains the default and override behavior. It lacks an explicit statement about non-destructiveness, but the framing is sufficient. It does not cover edge cases like missing packages, but that's not required for basic transparency.

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?

Three sentences, front-loaded with the core purpose. The first sentence states what it does, the second explains when to use it, and the third provides a practical default and override. No redundant or filler content—every sentence earns its place.

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

Completeness5/5

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

For a simple read tool, the description covers the key aspects: what it returns, when to prefer it, and how to specify a particular file. Combined with the fully-documented schema and absence of an output schema (raw text), the description provides adequate context for selecting and using the tool. It even references the sibling `list_type_files` to complete the usage flow.

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

Parameters4/5

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

The schema already covers 100% of parameters, so the baseline is 3. The description adds value by linking `file` to `list_type_files`, clarifying the `package@version` syntax, and noting the default types entry. This goes beyond mere schema repetition, earning a 4.

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 and specific verb phrase: 'Return the raw .d.ts declaration text for an npm package@version'. It explicitly identifies the resource (TypeScript declaration files) and distinguishes itself from siblings by mentioning 'ground-truth type definitions' and 'a summary can't capture', which sets it apart from package_api.

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?

Usage guidance is explicit: 'Use when you need exact signatures, generic parameters, overloads, or option-object shapes that a summary can't capture'. It also clarifies when to use the `file` parameter ('from list_type_files') and the default behavior, effectively directing the agent to the right alternative.

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/Anicodeth/pkg-api-mcp'

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