Skip to main content
Glama

open_document

Open a file in the LSP server to enable diagnostics, hover information, and code completions. Specify the file path and optional language ID for targeted analysis.

Instructions

Open a file in the LSP server for analysis. Use this tool before performing operations like getting diagnostics, hover information, or completions for a file. The file remains open for continued analysis until explicitly closed. The language_id parameter tells the server which language service to use (e.g., 'typescript', 'javascript', 'haskell'). The LSP server starts automatically on MCP launch.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textNo
file_pathYes
language_idNo
Behavior3/5

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

No annotations are provided, so the description must disclose behavioral traits. It states that 'The file remains open for continued analysis until explicitly closed' and that 'The LSP server starts automatically on MCP launch.' However, it does not mention idempotency, error handling for missing files, or whether reopening a file is allowed. Partial disclosure but not comprehensive.

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, approximately 70 words, with the most important information in the first sentence. No redundant or filler content. Each sentence adds value.

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 no annotations and no output schema, the description should cover usage, parameters, and behavior. It covers usage and behavior (file stays open) but does not explain the text parameter, return value, or error conditions. Moderately complete but with notable omissions.

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?

Schema description coverage is 0%, so the description must compensate. It explains the language_id parameter with examples ('typescript', 'javascript', 'haskell'), which adds meaning. However, it does not describe the text parameter at all, and file_path is self-explanatory. Partial coverage, leaving one parameter unexplained.

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 ('Open') and resource ('a file in the LSP server for analysis'), and distinguishes the tool from siblings by noting it is a prerequisite for diagnostic, hover, and completion operations. The sibling list includes similar tools like close_document, making the differentiation effective.

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 explicitly says 'Use this tool before performing operations like getting diagnostics, hover information, or completions for a file.' This provides clear context for when to use it. It does not mention when not to use or specific alternatives, but the usage guidance is sufficiently clear given the sibling tools.

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