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.
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": {
"costs": "<costs>",
"values": "<values>",
"budget": "<budget>"
},
"name": "cortex_context_pack"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| costs | Yes | Character/token costs of candidate chunks | |
| budget | Yes | Maximum character/token budget | |
| values | Yes | Relevance value scores of candidate chunks | |
| required_index | No | Mandatory failed-attempt warning index (-1 if none) |