Skip to main content
Glama

format_range

Get formatting edits for specific lines or characters in a document using LSP range formatting. Apply formatting to functions, blocks, or selections without modifying the entire file.

Instructions

Get formatting edits for a specific range within a document via LSP (textDocument/rangeFormatting). Returns TextEdit[] for the selected lines/characters only. Use this when you want to format a function, block, or selection rather than the entire file. The edits are NOT applied automatically.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
language_idNo
start_lineYes
start_columnYes
end_lineYes
end_columnYes
tab_sizeNo
insert_spacesNo
Behavior4/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 key behaviors: it returns 'TextEdit[] for the selected lines/characters only' and clarifies that 'The edits are NOT applied automatically,' which is crucial for understanding the tool's read-only nature and output format. However, it lacks details on error handling, permissions, or rate limits.

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 front-loaded with the core purpose in the first sentence, followed by usage guidance and behavioral details. Each sentence adds value: the first defines the tool, the second specifies when to use it, and the third clarifies the output and application behavior. There is no wasted text, making it highly efficient.

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?

Given the complexity of an LSP formatting tool with 8 parameters, no annotations, and no output schema, the description is partially complete. It covers purpose, usage, and key behaviors well, but lacks parameter explanations and details on return values (e.g., structure of TextEdit[]). This leaves gaps for effective tool invocation.

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

Parameters2/5

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

The schema description coverage is 0%, and the description does not explain any of the 8 parameters. It mentions 'selected lines/characters' which hints at the range parameters (start_line, start_column, etc.), but provides no details on their semantics, formats, or how they interact. This fails to compensate for the lack of schema descriptions, leaving parameters largely undocumented.

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 formatting edits for a specific range within a document via LSP (textDocument/rangeFormatting).' It specifies the verb ('Get formatting edits'), resource ('specific range within a document'), and mechanism ('via LSP'), and distinguishes it from the sibling tool 'format_document' by indicating it's for 'a function, block, or selection rather than the entire file.'

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?

The description provides explicit guidance on when to use this tool: 'Use this when you want to format a function, block, or selection rather than the entire file.' It contrasts with the sibling tool 'format_document' by specifying the alternative for formatting the whole file, making it clear when to choose this tool over others.

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