Skip to main content
Glama

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tagsNo
modelYes
paramsNo
promptYes
responseYesThe response text to cache
ttl_secondsNoFreshness lifetime in seconds. null = never expires. Default: 1 day
derived_fromNoIds of parent entries this was built from
stale_while_revalidate_secondsNoExtra window after TTL expiry where the entry is still returned, marked stale

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.1

TDQS

A4.4/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 behavioral burden, and it discloses non-obvious behavior: automatic similarity-graph linking, its effect on cache_related and cache_query, and cascade invalidation via derived_from. It stops short of stating duplicate-key behavior, return values, or key composition, but the main side effects are covered.

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

Conciseness5/5

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

Four sentences, each earning its place: purpose, usage timing, automatic linking behavior, and derived_from semantics. The most important action is front-loaded and no filler is present.

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

Completeness4/5

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

The description covers the critical workflow (post-miss write, graph linkage, cascade invalidation) well enough for an agent to invoke correctly with the required fields. Missing return-value expectations and duplicate-handling behavior are minor gaps given the absence of an output schema, but the core context is solid.

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 50%, and the description adds real meaning for derived_from (parent/cascade relationships). However, tags and the free-form params object receive no guidance, and the description does not compensate for those undocumented parameters. Optional fields like ttl_seconds rely entirely on the schema's default notes.

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?

The opening sentence 'Store a prompt/response pair in the cache' states a specific verb and resource, and the references to cache_get, cache_related, and cache_query clearly situate it among the sibling tools. An agent can immediately distinguish this write operation from the read/query/invalidate siblings.

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

Usage Guidelines5/5

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

The description explicitly instructs when to call: 'AFTER getting a fresh response from a model that cache_get did not have,' which names the triggering condition and the primary alternative (cache_get). The derived_from guidance adds a conditional usage rule for derived entries, leaving little ambiguity about when this tool is appropriate.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kskurtveit/echocache'

If you have feedback or need assistance with the MCP directory API, please join our Discord server