Skip to main content
Glama

vscode_get_editor_state

Get live VS Code editor state for AI context: active file path (Local or Remote-SSH), cursor line/column, selected text, open tabs, and workspace folders; optionally return all open windows.

Instructions

Get live VS Code state: active file path (Local or Remote-SSH), cursor line/column, currently highlighted/selected text, open tabs, and workspace folders.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "vscode_get_editor_state"
  }
}

Input Schema

NameRequiredDescriptionDefault
AllWindowsNoIf true, returns all open VS Code windows in addition to the active/latest window.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior3/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. The word "live" usefully signals that this reflects current editor state and the Remote-SSH mention warns of remote paths, but it does not state preconditions (e.g. a running VS Code instance or an open editor) or what happens when no file/tab exists. Read-only nature is implied by "Get" but never stated.

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?

One front-loaded sentence with the verb and the complete field list, no filler and no repetition. Every clause contributes a distinct returned data point.

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?

For a simple read-only state tool with no output schema, the description effectively substitutes for one by enumerating the return fields. The remaining gap is edge-case behavior when no active editor or window exists, which is minor for this complexity level.

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?

The single parameter has full schema coverage with its own description for AllWindows, so the baseline is 3. The tool description adds nothing about that parameter, nor does it need to; it also does not warn about the cost of returning all windows.

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?

The description names a specific verb and resource ("Get live VS Code state") and enumerates the exact fields returned: active file path with Local or Remote-SSH distinction, cursor line/column, selected text, open tabs, and workspace folders. That is far more specific than a restatement of the name and lets an agent separate it from vscode_get_diagnostics. It stops short of an explicit contrast with a sibling.

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?

There is no explicit when-to-use or when-not-to-use statement and no named alternative. Usage is only implied by the returned-data list: an agent infers it should call this when it needs editor context such as cursor position or open tabs. Adequate but leaves the routing decision entirely to inference.

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