flatten-mcp
Server Quality Checklist
Latest release: v2.6.1
- Disambiguation5/5
Each tool targets a distinct operation: flatten_session for session files, flatten_messages for in-memory arrays, unflatten_messages for reversing in-memory, and retrieve_flattened for retrieving backed-up content. No overlap in purpose.
Naming Consistency5/5All tool names follow a verb_noun pattern (e.g., flatten_session, unflatten_messages, retrieve_flattened). The pattern is consistent and predictable.
Tool Count5/5Four tools is well-scoped for the domain of conversation flattening and restoration. Each tool serves a specific need without unnecessary duplication.
Completeness3/5The set covers flattening and in-memory restoration, but misses an explicit unflatten_session tool, which is referenced in flatten_session's description as reversible. This gap may force agents to adapt.
Average 4.7/5 across 4 of 4 tools scored.
See the Tool Scores section below for per-tool breakdowns.
- No community issues in the last 6 months
- 56 commits in the last 12 weeks
- Last stable release on
- No critical vulnerability alerts
- No high-severity vulnerability alerts
- No code scanning findings
- CI is failing
This repository is licensed under MIT License.
This repository includes a README.md file.
No tool usage detected in the last 30 days. Usage tracking helps demonstrate server value.
Tip: use the "Try in Browser" feature on the server page to seed initial usage.
Add a glama.json file to provide metadata about your server.
This server has been verified by its author.
How to sync the server with GitHub?
Servers are automatically synced at least once per day, but you can also sync manually at any time to instantly update the server profile.
To manually sync the server, click the "Sync Server" button in the MCP server admin interface.
How is the quality score calculated?
The overall quality score combines two components: Tool Definition Quality (70%) and Server Coherence (30%).
Tool Definition Quality measures how well each tool describes itself to AI agents. Every tool is scored 1–5 across six dimensions: Purpose Clarity (25%), Usage Guidelines (20%), Behavioral Transparency (20%), Parameter Semantics (15%), Conciseness & Structure (10%), and Contextual Completeness (10%). The server-level definition quality score is calculated as 60% mean TDQS + 40% minimum TDQS, so a single poorly described tool pulls the score down.
Server Coherence evaluates how well the tools work together as a set, scoring four dimensions equally: Disambiguation (can agents tell tools apart?), Naming Consistency, Tool Count Appropriateness, and Completeness (are there gaps in the tool surface?).
Tiers are derived from the overall score: A (≥3.5), B (≥3.0), C (≥2.0), D (≥1.0), F (<1.0). B and above is considered passing.
Tool Scores
- Behavior4/5
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Beyond annotations (readOnlyHint, idempotentHint), the description adds that it is purely functional with no session file, disk, or network, and the input is never mutated. This enriches behavioral understanding.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Conciseness4/5Is the description appropriately sized, front-loaded, and free of redundancy?
The description is front-loaded with the action and each sentence adds value. While somewhat long, it is well-structured and informative without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Completeness4/5Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the output schema exists, the description appropriately focuses on usage and behavior. It covers the functional nature, persistence requirement, and alternative, making it complete for the tool's complexity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Parameters4/5Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, but the description adds meaning: it explains min_size is for blocks larger than N bytes, and that messages should be a raw Messages API array. This adds value beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Purpose5/5Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it flattens a raw Anthropic Messages API messages[] array in memory, swapping bulky tool_result blocks with markers and returning originals in 'extracted'. It uses a specific verb and resource, and distinguishes from siblings like unflatten_messages.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Usage Guidelines4/5Does the description explain when to use this tool, when not to, or what alternatives exist?
The description tells the agent to persist 'extracted' itself and feed it back to unflatten_messages for restoration. It also advises using the library directly for production, providing clear context on when to use this tool vs alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
- Behavior5/5
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations declare readOnlyHint=true and idempotentHint=true. Description reinforces with 'purely functional — no disk, no network, input never mutated.' Also details behavior for missing markers. Fully transparent and consistent with annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Conciseness5/5Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, no wasted words. First sentence defines the core function, second adds important caveats. Perfectly front-loaded and concise.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Completeness5/5Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the straightforward nature of the tool, the description covers the restoration process, marker handling, and principles (functional, idempotent). Output schema exists (as per context signal), so no need to detail return values. Comprehensive for the task.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Parameters4/5Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema descriptions provide clear definitions for both parameters (messages and extracted). The tool description adds behavioral context about the marker format and byte-for-byte restoration, enhancing understanding beyond schema. With 100% schema coverage, baseline is 3, but the additional context merits a 4.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Purpose5/5Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states it restores a conversation flattened by flatten_messages, re-inlining tool_result markers byte-for-byte. The verb 'restore' and resource 'conversation' are explicit. Distinguishes from sibling tools like flatten_messages by directly referencing the inverse operation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Usage Guidelines4/5Does the description explain when to use this tool, when not to, or what alternatives exist?
Implicitly specifies usage: use when you have a flattened conversation and want to restore it. Does not explicitly state when not to use or list alternatives, but the context of being the inverse of flatten_messages is clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
- Behavior5/5
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Discloses crash-safe atomic rewrite, reversible nature, estimation vs exact token savings for each agent, and behavior with 'current' under codex. No contradiction with annotations (readOnlyHint=false, destructiveHint=false). Adds extensive behavioral context beyond annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Conciseness4/5Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with core purpose; but the description is long and includes many details that could be condensed. However, given the tool's complexity, the length is justified and well-structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Completeness5/5Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Covers all aspects: agent differences, token calculation, session ID handling, directory paths, output fields mentioned. Comprehensive for a 10-parameter tool with output schema.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Parameters4/5Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema has 100% description coverage, so baseline is 3. The description adds moderate extra context, e.g., explaining dry_run reports without modifying, breakdown options in detail, and behavior of session_id. But the schema descriptions are already good, so only slight improvement.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Purpose5/5Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states the tool flattens Claude Code or Codex CLI sessions by moving bulky tool results to a backup copy and leaving compact markers. It distinguishes from siblings like unflatten_session and flatten_messages.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Usage Guidelines5/5Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides explicit guidance on when to use (to reduce context tokens), how to choose agent, fallback behaviors for different session_id values, and mentions reversible via unflatten_session. Clearly states alternatives and context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
- Behavior5/5
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description adds behavioral details beyond annotations: it explicitly states the backup is deleted, which aligns with destructiveHint=true. It also explains per-agent behavior and keyword scoping, providing full transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Conciseness5/5Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, each carrying essential information: core action in the first, agent-specific nuances in the second. No redundancy or fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Completeness5/5Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity (5 parameters, 1 required, output schema exists), the description covers all necessary aspects: purpose, behavioral details, parameter semantics, and agent-specific behavior. The output schema handles return values, so no gap.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Parameters5/5Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 100% schema coverage, baseline is 3. The description adds meaning by explaining how 'agent' selects the store, how 'session_id' handles UUID/keywords, and how 'project_dir' scopes lookups for codex. This significantly aids correct invocation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Purpose5/5Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool reverses a flatten operation by re-inlining tool results and deleting the backup. It distinguishes from siblings like flatten_session (the opposite) by specifying it restores the pre-flatten state.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Usage Guidelines4/5Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explains when to use (restoring a flattened session) and provides context for agent and scope selection. It lacks explicit when-not-to-use or alternatives, but the sibling list and context make it clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
- Behavior5/5
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint and idempotentHint. The description adds valuable context: it reads 'straight from its backup', returns original text output, and for flattened screenshots (claude) returns the actual image for viewing. No contradictions with annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Conciseness5/5Is the description appropriately sized, front-loaded, and free of redundancy?
The description is efficient and front-loaded, starting with the core purpose then immediately giving usage instructions. Every sentence adds value—no filler. It's appropriately sized for the tool's complexity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Completeness5/5Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has 6 parameters (2 required), a complex trigger pattern, and an output schema, the description covers all necessary aspects: trigger identification, parameter extraction, agent selection, default paths, and return types. The output schema exists and the description hints at what is returned (text or image), making it complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Parameters4/5Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with descriptions for all 6 parameters. The description adds extra meaning beyond the schema by explaining how to derive parameters from the FLATTENED marker (e.g., 'value after id=') and providing context for agent and directory defaults.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Purpose5/5Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool retrieves original tool result content from a flattened session, with a specific verb ('Retrieve') and resource ('original tool result content from a flattened session'). It distinguishes from sibling tools like flatten_session by explaining the use case of reading previously flattened content.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Usage Guidelines5/5Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly tells when to use the tool: when a [FLATTENED ...] marker appears in the conversation. It provides step-by-step instructions on extracting tool_use_id and session_id from the marker, setting the agent, and default values.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
GitHub Badge
Glama performs regular codebase and documentation scans to:
- Confirm that the MCP server is working as expected.
- Confirm that there are no obvious security issues.
- Evaluate tool definition quality.
Our badge communicates server capabilities, safety, and installation instructions.
Card Badge
Copy to your README.md:
Score Badge
Copy to your README.md:
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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