Skip to main content
Glama

Read editor code

get_code
Read-only

Read the current contents of a browser-based code editor and return the code along with its originating editor instance.

Instructions

Read the current contents of the code editor on the page. Returns the code plus which editor instance it came from.

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": "get_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
modelIndexNoWhich editor if the page has several

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered structurally. The description adds that the result includes both the code and the originating editor instance, which is useful context, but it says nothing about behavior when the page has no editor, when content is stale, or about size limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences, front-loaded with the action and scope, with the return content in second position. Nothing is wasted, though it is minimal enough that a slightly richer second sentence could have been added at no cost to readability.

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 one-parameter read tool with no output schema, this covers the core: what is read and what comes back. The remaining gap is edge-case behavior (no editor on page, multiple editors without modelIndex), which matters somewhat given openWorldHint=true but is minor for a simple reader.

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?

There is a single optional integer parameter with 100% schema description coverage ('Which editor if the page has several'), so the schema carries the meaning. The description's mention of 'which editor instance it came from' loosely echoes that parameter but adds no format or selection detail beyond the schema; baseline 3 applies.

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 gives a specific verb and resource — 'Read the current contents of the code editor' — which separates it from the page-content reader and the code-writing sibling by virtue of targeting the editor specifically. It stops short of naming any alternative explicitly, so the differentiation is contextual rather than stated.

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?

Usage is only implied: 'the current contents' suggests a live read of an open editor, and the sibling set implies set_code for writes and inspect_editor for metadata. There is no explicit when-to-use, when-not-to-use, or guidance on what to do if no editor is present on the page.

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