Skip to main content
Glama

context-pack

Pick context blocks that fit a token budget, keeping mandatory blocks and their dependencies — Chooses which context items an agent should put into a prompt without exceeding a token budget: every mandatory item and everything it depends on is always included, then optional items by descending priority (each with the dependencies it pulls in) while they fit. Token counts come from the caller or from o200k_base / cl100k_base; any other tokenizer name returns unsupported (there is no Claude t

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "items": "<items>",
      "budget": "<budget>"
    },
    "name": "context-pack"
  }
}

Input Schema

NameRequiredDescriptionDefault
itemsYesUp to 500 items, 300000 characters of text in total.
budgetYesMaximum total tokens (including perItemOverhead per included item).
tokenizerNoo200k_base or cl100k_base. Any other name (including Claude models) returns status unsupported for items that need counting; caller token counts are always accepted.
perItemOverheadNoTokens added per included item for separators or wrappers. Default 0.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses that mandatory items and their transitive dependencies are always included, that failure occurs if they cannot fit, that caller-supplied token counts take precedence over counting text, and that unsupported tokenizer names yield an 'unsupported' status. It stops short of describing the overall response shape or what a partial result looks like.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

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

The opening clause and the sentence after the dash restate the same idea ('Pick context blocks that fit a token budget' / 'Chooses which context items an agent should put into a prompt without exceeding a token budget'), which is wasted space. The text is also cut off mid-sentence ('there is no Claude t'), leaving a dangling fragment.

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?

There is no output schema, so the description should explain what the tool returns; it only alludes to statuses ('unsupported', 'fail') without describing the result structure or how included/excluded items are reported. For a packing tool with non-trivial failure modes, that is a meaningful gap.

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 the baseline is 3, but the description adds real meaning beyond the schema: it clarifies the tokenizer fallback chain (caller counts, then o200k_base/cl100k_base, otherwise unsupported) and that per-item overhead is charged per included item. That is genuine semantic value on top of the field 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?

States a specific verb and resource ('Pick context blocks that fit a token budget') and immediately specifies the selection rule: mandatory items plus dependencies first, then optional items by descending priority. An agent can tell exactly what this tool produces without opening the schema.

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 makes the usage context clear — deciding which context items to place in a prompt under a token budget — and explains the mandatory/optional precedence that governs behavior. It does not name an alternative tool or state when not to use it, so it falls short of a 5.

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.

Resources