Skip to main content
Glama

execute_command

Trigger server-defined commands from code actions to perform refactoring, code generation, or other server-specific operations.

Instructions

Execute a workspace command via LSP. Commands are server-defined identifiers returned by code actions (in the command field of a CodeAction). Use this after get_code_actions to trigger a server-side operation such as applying a refactoring, generating code, or running a server-specific action. Returns the server-defined result or null.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYes
argumentsNo
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It mentions that the tool triggers a server-side operation and returns a server-defined result or null, but it does not disclose potential side effects, destructiveness, authentication requirements, or error behavior. The description is adequate but lacks depth.

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 concise at two sentences, each serving a clear purpose: the first states the action and links to code actions, the second provides usage context and return information. No unnecessary words.

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's complexity (2 params, no output schema), the description covers the essential task, source of commands, and return type. It lacks details on error handling or edge cases, but for a command execution tool, the provided information is mostly complete.

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 coverage is 0%, but the description partially compensates by explaining that the 'command' parameter is a server-defined identifier from code actions. The 'arguments' parameter is not elaborated beyond being optional and an array. Some value is added, but full parameter understanding still requires inference.

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 executes a workspace command via LSP, explicitly linking it to code actions (command field of CodeAction). This distinguishes it from siblings like get_code_actions (which retrieves actions) and apply_edit (which applies edits). The verb 'execute' and resource 'workspace command' are specific.

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 advises 'Use this after get_code_actions' and provides concrete examples of when to use it (refactoring, generating code, server-specific action). It also mentions the return type. However, it does not explicitly state when not to use it or mention alternatives among the many 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