Skip to main content
Glama

cw_document_state

Checks whether SONAR has a project open by reading the window title, so agents know if document, view, and track commands are available before acting.

Instructions

Whether SONAR has a document open, read from the window title — the one piece of project state this process can see. This gates a lot: with no project the menu bar has only the application-level menus and the track controls do not exist, which makes view and document commands look broken. With a project open the menu tree is 270 entries and the track strips appear.

Input Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and provides substantial behavioral context: it reads the window title, discloses downstream effects (menu bar composition, track controls existing or not, menu tree size), and explains why commands can appear broken. It stops short of explicitly stating the tool is read-only or describing the exact boolean return format, but the critical operational behavior is disclosed.

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 three sentences, front-loaded with the core definition, and every sentence earns its place by explaining why the state matters. There is no repetition or filler; the detail about menu tree size and track strips is directly useful for interpreting the output.

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, parameterless boolean state check with no annotations or output schema, the description is largely complete: it explains what is checked and why it matters. It could be improved by explicitly stating the return type and that the tool is read-only, but the gating context covers the main ambiguity.

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?

The tool has zero parameters, so there are no parameter semantics to document and the schema coverage is 100%. The description appropriately adds no parameter details, matching the baseline for parameterless tools.

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 clearly states that the tool reports whether SONAR has a document open, read from the window title, and explains its scope as the one piece of project state this process can see. It distinguishes itself from generic state tools through this specific framing, though it does not explicitly differentiate from siblings like cw_get_state or cw_status.

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 through the gating explanation: with no project, view and document commands look broken, so an agent can infer it should check this state before such commands. However, there is no explicit when-to-use guidance or named alternatives, leaving the agent to infer the correct sequencing.

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