Skip to main content
Glama
gclluch

TypeScript AST MCP Server

by gclluch

get_type_definition

Get the full source definition of any type—interface, type alias, class, or enum—by entering the type name and path to the TS/JS file.

Instructions

Extracts the full definition of any type (interface, type alias, class, enum) by name

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the type to extract
pathYesAbsolute path to the TS/JS file
Behavior2/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 only says 'extracts,' which does not disclose whether the operation is read-only, what happens if the type does not exist, or the exact return format. It lacks behavioral context beyond what the tool name already implies.

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?

A single sentence of 12 words, front-loaded with the verb and target, with no redundant information. Every word earns its place.

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?

The tool is simple, the schema fully documents both parameters, and the description communicates the main use case and supported type kinds. It omits details like return format and error behavior, but these are not critical for this activity, making the description sufficiently complete.

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?

Schema coverage is 100%, giving baseline 3. The description adds valuable meaning by specifying the supported type kinds (interface, type alias, class, enum), clarifying what the 'name' parameter can refer to beyond the schema's generic 'Name of the type to extract.'

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 action (extracts), the target (full definition), and names specific type categories (interface, type alias, class, enum). This distinguishes it from sibling tools like list_declarations or analyze_file, which either enumerate or analyze rather than extract a specific type definition.

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 phrase 'by name' provides clear context for when to use this tool: when the agent knows the type name and needs its full definition. It does not explicitly mention alternatives or exclusions, but the purpose is so focused that the usage context is obvious.

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/gclluch/ts-ast-mcp'

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