Skip to main content
Glama
Chia1104

tsserver-mcp-server

by Chia1104

get_type_definition

Get the definition location of a type at the cursor in TypeScript or JavaScript. Provide file content and cursor line/column to find the source definition.

Instructions

Get the definition location of the type at the cursor

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lineYesCursor line (1-based)
offsetYesCursor column (1-based)
filePathYesFile path (absolute or relative to project root)
fileContentYesFile content (TypeScript/JavaScript source code)
projectPathNoProject root (directory with node_modules/tsconfig). When set, the server reads project files from disk so imports (e.g. zod) and cross-file features work.
Behavior2/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It only states 'Get the definition location' without revealing whether this is a read-only operation, what the response format is, or how the optional projectPath influences file reading. The agent is left uninformed about side effects or limitations.

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, front-loaded sentence that immediately communicates the core action. It contains no filler or redundant content, making it highly concise and easy to parse.

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

Completeness2/5

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

The tool has no output schema, so the description should explain return values, but it only mentions a vague 'definition location.' It also fails to mention important context such as the role of projectPath in enabling cross-file type resolution, leaving the description incomplete for a language-server tool with multiple parameters and siblings.

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 provides 100% coverage with clear descriptions for all five parameters, including the nuanced projectPath. The tool description adds no additional parameter meaning beyond what the schema already offers, so the baseline score of 3 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 tool's purpose: 'Get the definition location of the type at the cursor.' It uses a specific verb and resource, and the word 'type' distinguishes it from the sibling 'get_definition' which presumably retrieves the symbol's definition rather than its 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 Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives like get_definition or get_quick_info. There is no mention of context, prerequisites, or exclusion criteria, leaving the agent to infer usage solely from the name.

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/Chia1104/tsserver-mcp-server'

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