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).

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.
authorizationNo

Schema Changelog

Changes observed during successful MCP inspections.

No schema history has been recorded yet.

TDQS

A4.1/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and does so thoroughly: it discloses that the close is immediate and persisted, that persistence is best-effort with failures logged rather than fatal, how focus is transferred (next_focus if still open, else next remaining), and that closing the last document leaves the session empty. This is exactly the side-effect and failure-mode context an agent needs for a mutation with zero annotation coverage.

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 tight paragraphs: behavior first, persistence caveat second, with the key action and the focus fallback chain front-loaded. Nearly every sentence earns its place, though the phrasing is dense enough that a small trim would still preserve all signal.

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 parameterized mutation with no output schema, the description explains side effects, focus behavior, and the returned roster + HTML, which is sufficient to call it correctly. The only material omission is any mention of the authorization parameter.

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 description coverage is low (20%, only include_html documented), so the description must compensate. It usefully explains document_id's role and the otherwise-undocumented next_focus selection logic, and the return payload covers the output side. But it adds nothing about authorization or session_id, leaving part of the coverage gap unfilled.

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 states a specific verb and resource ('Remove document_id from the session's open documents') and anchors it to a concrete UI metaphor ('the tab close button'), making the operation instantly recognizable. The contrast with siblings like archive_document or focus_session_document is implicit but unmistakable given the 'open documents' scope.

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 tab-close framing and the note that a later reconnect/restore won't restore the document, which signals intent. However, it never names an alternative (e.g., archive_document for durable removal) or states when-not to use this tool, leaving routing to inference.

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.