Skip to main content
Glama

vscode_execute_command

Executes built-in or extension VS Code commands by ID, optionally with arguments, to automate editor actions and extension workflows.

Instructions

Execute any built-in or extension VS Code command ID (e.g., "editor.action.formatDocument", "cmake.build", "workbench.action.files.saveAll").

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "Command": "<Command>"
    },
    "name": "vscode_execute_command"
  }
}

Input Schema

NameRequiredDescriptionDefault
ArgsNoOptional array of arguments passed to the command.
CommandYesVS Code command identifier.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.3/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full disclosure burden. It reveals only that arbitrary commands are accepted; it says nothing about whether commands can mutate files or workspace state, whether execution is synchronous, what happens when a command ID is invalid or the command fails, or what (if anything) is returned. For an arbitrary command-execution surface this is a notable gap.

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?

A single front-loaded sentence with no filler; the examples are the most valuable part and are placed inline where the agent will read them. Nothing is redundant with the title or schema.

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

Completeness2/5

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

With no annotations and no output schema, the description must cover behavior and return semantics itself, and it does not — the agent cannot tell whether a result is returned, whether errors surface, or how to discover valid command IDs. For a tool that can run any extension command, that leaves the caller guessing on the aspects that most affect safe invocation.

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?

Schema coverage is 100% and both parameters are documented in the schema, so the baseline is 3. The description earns above baseline by giving three concrete command IDs ('editor.action.formatDocument', 'cmake.build', 'workbench.action.files.saveAll'), which conveys the dot-separated namespace convention that the schema's 'VS Code command identifier' does not. Args is not addressed in the description, but the schema covers it adequately.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (execute) and resource (VS Code command ID), and the parenthetical examples make the scope concrete: both built-in and extension commands are valid targets. It does not, however, differentiate itself from the sibling run_command or explain when a raw command ID is the right entry point versus dedicated tools like vscode_open_file or edit_file.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'any built-in or extension VS Code command ID' implies the precondition that the caller already knows a command ID, but there is no explicit when-to-use guidance, no when-not-to-use, and no mention of the alternative run_command. The agent must infer the routing decision from the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.