Skip to main content
Glama

Replace a document's source

set_document_source

Replace a document's full ArchScript source in one undoable step and return diagnostics; specify a document or omit to use the frontmost.

Instructions

Replaces the whole source of a document (one undoable step in the user's window). Returns diagnostics.

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": {
      "source": "<source>"
    },
    "name": "set_document_source"
  }
}

Input Schema

NameRequiredDescriptionDefault
sourceYesComplete new ArchScript source.
documentNoDocument id (e.g. doc1), file name or project name. Omit for the frontmost document.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description carries the behavioral burden, and it does disclose two useful traits: the replacement is 'one undoable step in the user's window' and it 'Returns diagnostics'. It still omits details such as validation behavior, failure modes, or whether existing content is overwritten immediately versus staged.

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 two tightly written sentences with no wasted wording. The core action and its undoability are front-loaded, and the return note follows efficiently.

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 two-parameter mutation tool with no output schema, the description supplies the essential behavior: whole-source replacement, undoability, and diagnostics on return. It could still say more about how diagnostics should be interpreted or when to prefer edit_document, but the core invocation context is present.

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 100%, so the input schema already documents both the required source and optional document parameters. The description reinforces that the source is a complete replacement, but adds no additional parameter meaning beyond what the schema provides.

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 uses a specific verb, 'Replaces', and a precise resource scope, 'the whole source of a document'. The phrase 'whole source' implicitly distinguishes it from finer-grained editing via edit_document, so an agent can tell what this tool does at a glance.

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 implied by the scope: use this when replacing an entire document source rather than making small edits. However, the description does not explicitly name edit_document as the alternative or state when not to use this tool.

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