cache_set
Store a prompt/response pair to reuse later. After a cache miss, save the fresh model response; related content is automatically linked for similarity queries.
Instructions
Store a prompt/response pair in the cache. Call this AFTER getting a fresh response from a model that cache_get did not have. New entries are automatically linked in a similarity graph to existing entries with related content, so cache_related and cache_query can surface them later even without an exact key match. Pass derived_from with parent entry ids if this result was built from other cached entries — invalidating a parent with cascade can then clean up anything derived from it.
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": {
"model": "<model>",
"prompt": "<prompt>",
"response": "<response>"
},
"name": "cache_set"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tags | No | ||
| model | Yes | ||
| params | No | ||
| prompt | Yes | ||
| response | Yes | The response text to cache | |
| ttl_seconds | No | Freshness lifetime in seconds. null = never expires. Default: 1 day | |
| derived_from | No | Ids of parent entries this was built from | |
| stale_while_revalidate_seconds | No | Extra window after TTL expiry where the entry is still returned, marked stale |