Skip to main content
Glama

cortex_context_pack

Select and pack relevant context chunks under a token budget using dynamic programming, reserving the top-ranked failed-attempt warning first.

Instructions

Optimal 0/1 dynamic-programming knapsack context selector (ROMS engine) that reserves the highest-ranked failed-attempt warning first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
costsYesCharacter/token costs of candidate chunks
budgetYesMaximum character/token budget
valuesYesRelevance value scores of candidate chunks
required_indexNoMandatory failed-attempt warning index (-1 if none)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.1/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full behavioral burden. It discloses the selection algorithm and the special rule that the highest-ranked failed-attempt warning is reserved first, but it omits side effects, return behavior, error conditions, and whether the operation is purely read-only.

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?

The description is a single compact sentence with no obvious filler, and it front-loads the core mechanism before the special reservation rule. The dense jargon and engine name make it slightly less accessible, but the structure is otherwise efficient.

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

Completeness2/5

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

For a non-trivial optimization tool with four parameters and no output schema, the description is too sparse. It does not explain the expected return shape or edge cases such as what happens when the required warning cannot fit within the budget.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/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 all four parameters. The description adds only a small amount of meaning by indicating that the required index corresponds to a highest-ranked failed-attempt warning that is reserved first, without further clarifying costs, values, or budget.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific resource and mechanism: it selects context chunks via an optimal 0/1 dynamic-programming knapsack method. It is clear what the tool does at a technical level, though it does not distinguish itself from any sibling tool by name or scope.

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

Usage Guidelines2/5

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

No guidance is given about when to use this tool versus alternatives, nor about prerequisites or exclusions. The only conditional behavior mentioned, reserving the failed-attempt warning first, is an internal rule rather than usage guidance.

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