Skip to main content
Glama

knitbrain_optimize

Compress JSON, code, or prose into a token-efficient skeleton while preserving the original locally for lossless recovery. Skips compression when not beneficial.

Instructions

Compress a payload (JSON / code / prose) into a token-cheap skeleton. The exact original is stored locally and recoverable via knitbrain_retrieve using the returned ⟨recall:hash⟩. Returns the original unchanged if compression wouldn't help.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesThe payload to optimize.
Behavior4/5

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

With no annotations, the description covers key behaviors: compression, local storage, recoverability via hash, and the no-op case. It does not detail side effects like resource usage or permissions, but is transparent enough for safe use.

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 extremely concise—two sentences that efficiently convey the core functionality, storage, recovery, and an important edge case (no compression benefit). No unnecessary words.

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

Completeness3/5

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

Given the lack of an output schema, the description should clarify the return format more explicitly. It mentions returning a hash for recovery and the original when unchanged, but the exact structure of the compressed output is vague, requiring the agent to infer or test.

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?

The schema provides a minimal description for 'text' ('The payload to optimize.'). The tool description significantly adds context by specifying acceptable content types (JSON, code, prose) and explaining the compression outcome, which helps the agent choose appropriate inputs.

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 tool compresses payloads (JSON/code/prose) into a token-cheap skeleton and preserves the original for recovery. It distinguishes from any sibling tools by mentioning a specific recovery path via knitbrain_retrieve.

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?

The description implies usage when token savings are desired (since it returns original unchanged if compression wouldn't help) but does not explicitly state when to use this tool over alternatives or when not to use it.

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/PDgit12/knitbrain'

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