Skip to main content
Glama

format_range

Get formatting edits for a selected range of lines or characters in a document. Use to format a function, block, or selection without altering 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
end_lineYes
tab_sizeNo
file_pathYes
end_columnYes
start_lineYes
language_idNo
start_columnYes
insert_spacesNo
Behavior4/5

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

The description discloses that the tool returns TextEdit[] and that edits are not applied automatically. It does not mention prerequisites like document openness or side effects, but given no annotations, it covers key behavioral traits adequately. Lacks details on permissions or error conditions.

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 three sentences, each adding distinct value: purpose, usage guidance, and behavioral note. No unnecessary words. Information is front-loaded.

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?

Given the tool has 8 parameters and no output schema, the description covers core functionality and usage context well. It lacks parameter documentation and prerequisites, but still provides sufficient context for an agent to understand when and how to invoke it.

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?

Schema description coverage is 0% and the description provides no detailed explanation of parameters like file_path, start_line, etc. It only alludes to 'selected lines/characters' without mapping to the schema. With 8 parameters and no other documentation, the description fails to add meaning beyond the schema.

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 verb 'Get', the resource 'formatting edits for a specific range', and specifies it's via LSP (textDocument/rangeFormatting). It distinguishes from formatting the entire file by mentioning 'specific range' and implicitly from sibling tools like format_document.

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 explicitly says 'Use this when you want to format a function, block, or selection rather than the entire file.' It also notes that edits are NOT applied automatically, guiding the user on the expected workflow. This provides clear context for when to choose this tool over alternatives.

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