Skip to main content
Glama
kompas-mcp

kompas-mcp

by biryak

Close document

doc_close
Destructive

Closes a document while handling unsaved changes: save before closing or explicitly discard changes only after user confirmation.

Instructions

Close a document. A document with unsaved changes is closed only with save=true or discard_changes=true; otherwise CONFIRMATION_REQUIRED tells you to ask the user.

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": {
      "doc": "<doc>"
    },
    "name": "doc_close"
  }
}

Input Schema

NameRequiredDescriptionDefault
docYesDocument handle from doc_list/doc_open, e.g. 'doc:12001:0a1b2c3d'
saveNoSave in place before closing
discard_changesNoClose WITHOUT saving unsaved changes (only after the user explicitly agreed to lose them)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.2

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already flag this as destructive and non-idempotent, but the description adds real behavior the annotations cannot convey: the unsaved-changes guard, the exact error token CONFIRMATION_REQUIRED, and the obligation to confirm with the user before discarding. It does not describe what a successful close returns or whether the handle becomes invalid afterwards.

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?

Two short sentences: the action first, then the guard condition and the alternative flag. Nothing is redundant and the blocking rule is front-loaded where an agent will read it before calling.

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 three-parameter mutation with no output schema, the definition covers the failure mode, the required flags, and the user-confirmation policy, which is what an agent needs to call it safely. It is slightly incomplete on post-close state, such as whether the document handle is still usable.

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%, so the baseline would be 3, but the description adds the conditional relationship between save and discard_changes that the schema does not state explicitly: closing a dirty document requires one of them. That is genuine meaning beyond the per-parameter descriptions.

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 ('Close a document'), so the operation is unambiguous and clearly distinct from doc_save or doc_create. It stops short of naming the nearest sibling (doc_save) as the alternative for persisting changes without closing, so the differentiation is implied 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 Guidelines4/5

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

It states the precise condition under which closing is blocked and the two flags that unblock it, plus the instruction to ask the user when CONFIRMATION_REQUIRED is returned. It does not say when to prefer closing over saving-then-closing or when to abandon a document entirely, but the operational context is clear.

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