Skip to main content
Glama

Server Details

Cut a Claude Code session's context tokens losslessly — the reversible alternative to /compact.

Status
Healthy
Last Tested
Transport
Streamable HTTP
URL

Glama MCP Gateway

Connect through Glama MCP Gateway for full control over tool access and complete visibility into every call.

MCP client
Glama
MCP server

Full call logging

Every tool call is logged with complete inputs and outputs, so you can debug issues and audit what your agents are doing.

Tool access control

Enable or disable individual tools per connector, so you decide what your agents can and cannot do.

Managed credentials

Glama handles OAuth flows, token storage, and automatic rotation, so credentials never expire on your clients.

Usage analytics

See which tools your agents call, how often, and when, so you can understand usage patterns and catch anomalies.

100% free. Your data is private.
Tool DescriptionsA

Average 4.7/5 across 2 of 2 tools scored.

Server CoherenceA
Disambiguation5/5

The two tools have completely distinct roles: one flattens messages, the other restores them. No overlap or ambiguity.

Naming Consistency5/5

Both tools follow a consistent verb_noun pattern (flatten_messages, unflatten_messages), making their purpose clear.

Tool Count4/5

Two tools is minimal but perfectly scoped for a single compression/decompression pair, though slightly on the low end.

Completeness5/5

The pair provides a complete cycle for flattening and unflattening tool results; no missing operations for the defined purpose.

Available Tools

2 tools
flatten_messagesFlatten messages[] (in memory)A
Read-onlyIdempotent
Inspect

Flatten a raw Anthropic Messages API messages[] array in memory: every bulky tool_result block (large text or base64 image) larger than min_size bytes is swapped for a compact [FLATTENED id=...] marker, and the originals are returned in "extracted". Persist "extracted" yourself — you are the store — and feed it back to unflatten_messages to restore the conversation byte-for-byte. Purely functional: no session file, no disk, no network; the input is never mutated. This is the same engine as the flatten-mcp library export; for production use inside your own process, prefer importing the library so the conversation does not travel over a transport.

ParametersJSON Schema
NameRequiredDescriptionDefault
messagesYesThe raw Messages API messages[] array ({ role, content } objects, verbatim).
min_sizeNoOnly flatten tool_result blocks larger than N serialized bytes.

Output Schema

ParametersJSON Schema
NameRequiredDescription
messagesYesThe flattened messages[] array — safe to send — with every bulky tool_result replaced by a compact [FLATTENED id=...] marker. Deep-copied; the input is never mutated.
extractedYesThe originals removed from the conversation. Persist this array yourself and pass it back to unflatten_messages to restore byte-for-byte.
flattenedCountYesHow many tool_result blocks were flattened.
contextTokensExactYesAlways false here — the in-memory tool never makes a network call; use the library flattenMessagesExact for an exact count.
contextTokensSavedYesEstimated context tokens removed from the conversation.
imageBlocksFlattenedYesHow many image blocks were among the flattened results.
Behavior4/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: 'purely functional: no session file, no disk, no network; the input is never mutated', and explains the output format including the 'extracted' array. Does not contradict 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/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single paragraph with dense, front-loaded information. Every sentence adds value, though slightly verbose with the library export detail. Still efficient for the included depth.

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?

With output schema present, no need to detail return values. The description covers the process, persistence expectation, and relationship to sibling tool. No gaps given the tool's complexity.

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 baseline is 3. The description adds meaning by characterizing 'messages' as 'verbatim raw API' and explaining the 'min_size' threshold for flattening. This additional context justifies a 4.

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 uses a specific verb ('Flatten') and resource ('raw Anthropic Messages API messages[] array'), clearly differentiates from sibling 'unflatten_messages', and explains the mechanism (replacing bulky tool_result blocks with markers).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

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

Explicitly states when to use (in-memory flattening for transport), what to do with the extracted data ('Persist "extracted" yourself'), and mentions the alternative library import for production. Also references the complementary sibling 'unflatten_messages'.

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

unflatten_messagesUnflatten messages[] (in memory)A
Read-onlyIdempotent
Inspect

Restore a conversation flattened by flatten_messages: re-inlines every tool_result whose content is a [FLATTENED id=...] marker from the matching entry in "extracted", byte-for-byte. Markers with no matching entry are left in place. Purely functional — no disk, no network, input never mutated.

ParametersJSON Schema
NameRequiredDescriptionDefault
messagesYesThe flattened messages[] array (the "messages" field of a flatten_messages result).
extractedYesThe "extracted" array returned by flatten_messages for this conversation.

Output Schema

ParametersJSON Schema
NameRequiredDescription
messagesYesThe restored messages[] array, byte-for-byte identical to the pre-flatten conversation. Any [FLATTENED id=...] marker with no matching extracted entry is left in place.
Behavior5/5

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

Annotations already provide readOnlyHint=true and idempotentHint=true. The description adds valuable behavioral context: byte-for-byte restoration, handling of missing markers (left in place), and pure functional nature (no mutation). 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/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, each earning its place. The main action is front-loaded, and no extraneous information is included.

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?

The description is complete for the tool's complexity. Annotations and the presence of an output schema (not shown but indicated) reduce the need for extensive return value details. The description covers behavior, edge cases (missing markers), and safety (purely functional).

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 description coverage is 100%, so the schema already documents the parameters. The description adds context by specifying that messages is the output of flatten_messages and extracted is the corresponding array, which provides semantic meaning beyond the generic schema descriptions.

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 clearly states the verb 'restore' and the resource 'conversation flattened by flatten_messages', with specific details about re-inlining markers byte-for-byte. It effectively distinguishes from the sibling tool 'flatten_messages' by describing 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/5

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

The description notes that the tool is 'purely functional — no disk, no network', implying when it is safe and appropriate to use. It does not explicitly provide when-not-to-use scenarios, but the context is clear as the counterpart to flatten_messages.

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

Discussions

No comments yet. Be the first to start the discussion!

Try in Browser

Your Connectors

Sign in to create a connector for this server.

Resources