Skip to main content
Glama

WritersLogic agent-infra

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

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources