Skip to main content
Glama

get_semantic_tokens

Extract semantic token types and modifiers for code elements within a specified file range to understand their syntactic roles, distinct from documentation.

Instructions

Get semantic tokens for a range in a file. Returns each token's type (function, variable, keyword, parameter, type, etc.) and modifiers (readonly, static, deprecated, etc.) with 1-based line/character positions. Use this to understand the syntactic role of code elements — distinct from hover which gives documentation. Only available when the language server supports textDocument/semanticTokens.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
language_idNo
start_lineYes
start_columnYes
end_lineYes
end_columnYes
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes what the tool returns ('each token's type and modifiers with 1-based line/character positions') and the availability constraint. However, it doesn't mention error conditions, performance characteristics, or whether this is a read-only operation (though 'Get' implies it).

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 efficiently structured in three sentences: first states the core functionality, second details the return format, third provides crucial usage context and constraints. Every sentence adds essential information with zero wasted words.

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

Completeness3/5

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

For a tool with 6 parameters, 0% schema coverage, no annotations, and no output schema, the description does reasonably well by explaining what semantic tokens are and their format. However, it leaves significant gaps: no parameter guidance, no error handling information, and limited behavioral context beyond the basic return format.

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?

With 0% schema description coverage for 6 parameters, the description must compensate but provides no parameter-specific information. However, the description implicitly clarifies that parameters define a file range for token analysis, which adds semantic context beyond the bare schema. This partial compensation earns a score above baseline but not full marks.

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 with specific verb ('Get') and resource ('semantic tokens for a range in a file'), distinguishing it from siblings like 'get_document_symbols' or 'get_inlay_hints' by focusing on token-level syntactic analysis rather than documentation or other code intelligence features.

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 provides clear context for when to use this tool ('to understand the syntactic role of code elements — distinct from hover which gives documentation') and mentions a prerequisite ('Only available when the language server supports textDocument/semanticTokens'). However, it doesn't explicitly state when NOT to use it or name specific alternative tools among the many siblings.

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/blackwell-systems/agent-lsp'

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