Skip to main content
Glama

retrieve_flattened

Retrieve original tool result content from a flattened session. Provide the tool_use_id and session_id from [FLATTENED] markers to get back the original text or image.

Instructions

Retrieve original tool result content from a flattened session. When you see [FLATTENED id=XXX tool=Read ... | text NNNB/NNL | session=YYY | ...] in the conversation, call this with the value after "id=" as tool_use_id and the value after "session=" as session_id. Returns the original text output, or — for flattened screenshots — the actual image so you can view it again.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tool_use_idYesValue after "id=" in the [FLATTENED id=XXX ...] marker
session_idYesValue after "session=" in the [FLATTENED ... session=YYY ...] marker
project_dirNoAbsolute path to project. Default: the project the CLI runs in (cwd)
Behavior3/5

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

No annotations provided, so description carries full burden. It discloses return types (text or image) but omits potential side effects, storage details, or permission requirements. Adequate but not detailed.

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 sentences, no wasted words. First sentence states purpose, second provides usage instructions. Front-loaded and efficient.

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, but description sufficiently explains return types and the context of flattened markers. For a simple retrieval tool, it covers all necessary information.

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 covers all parameters with descriptions, but the tool description adds critical context on how to extract values from markers (e.g., 'value after "id="'), which goes beyond the schema.

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?

Description clearly states it retrieves original tool result content from a flattened session, specifies the context with [FLATTENED ...] markers, and distinguishes from sibling tools like flatten_session and list_sessions.

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?

Explicitly tells when to call it—when seeing a [FLATTENED ...] marker—and how to extract parameters. No exclusions or alternatives mentioned, but sibling tools are distinct.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/shayaShav/flatten-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server