Skip to main content
Glama

Typebar (formerly SuperDocs)

close_session_document

Remove document_id from the session's open documents (the tab close button). If it's the focused document, focus another open document — next_focus if it's still open (so the client can pick the adjacent tab), else the next remaining one; closing the last document leaves the session empty. Returns the updated document roster + the now-focused document's HTML.

The close takes effect immediately and is persisted, so a later reconnect or session restore won't bring the closed document back. Persistence is best-effort — a failure is logged, not fatal (the close still holds for the active session).

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": {
      "session_id": "<session_id>",
      "document_id": "<document_id>"
    },
    "name": "close_session_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
next_focusNo
session_idYes
document_idYes
include_htmlNoInclude each document's full reassembled HTML body. Default false (token-light — recommended for AI agents enumerating or switching tabs): returns only ids, title, section count, focused flag, and page setup, omitting the body which can be hundreds of KB per document. The web app passes true to render document content.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/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 does substantial work: immediate effect, persistence across reconnect/session restore, and best-effort persistence where a failure is logged but non-fatal. It also documents the focus-fallback cascade and the last-document case. The one notable gap is behavior when document_id is not actually open (error vs. no-op).

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?

Front-loaded with the core action, then the focus cascade, then the return value, then persistence caveats — a sensible ordering. Slightly verbose in the final paragraph ('Persistence is best-effort — a failure is logged, not fatal' plus a restatement in parentheses), but every sentence carries real information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, and the description compensates by naming the return payload (updated document roster plus the now-focused document's HTML). Combined with the focus-cascade and persistence semantics, an agent has enough to call this correctly and anticipate the side effects.

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 only 25% — include_html is the sole documented parameter — so the description must compensate, and it does for the opaque one: next_focus is explained as the preferred adjacent tab that is only honored 'if it's still open'. session_id and document_id are self-evident from naming. It does not restate include_html or clarify whether document_id must be an already-open document.

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?

States a specific verb and resource: 'Remove document_id from the session's open documents', with a concrete parenthetical anchor ('the tab close button'). That framing immediately distinguishes it from siblings like focus_session_document, open_documents, and archive_document without opening any schema.

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?

The 'tab close button' analogy makes the use case obvious and the focus-cascade rules imply this is a mutation, not a navigation tool (contrast with focus_session_document). However, it never explicitly names an alternative or states when-not to use it, so the routing guidance is implied rather than stated.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.