Skip to main content
Glama

cache_set

Store key-value pairs in a cache instance with optional expiration time. Supports strings and JSON objects for persistent AI memory across development sessions.

Instructions

Set a key-value pair in a running cache instance. Value can be a string or a JSON-serialized object. Optionally set a TTL in seconds.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
instance_idYes
keyYesCache key
valueYesValue to store (string or JSON)
ttlNoTime-to-live in seconds (optional, omit for no expiry)
Behavior2/5

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

No annotations are provided, so the description carries full burden. It discloses that this is a write operation ('Set') and mentions TTL behavior, but doesn't cover critical aspects like whether it overwrites existing keys, requires specific permissions, has rate limits, or what happens on failure. For a mutation tool with zero annotation coverage, this leaves significant behavioral gaps.

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?

Two sentences with zero waste: the first states the core purpose and value format, the second adds TTL details. It's front-loaded with the main action and efficiently covers key aspects without redundancy.

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

Completeness3/5

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

Given no annotations and no output schema, the description is incomplete for a mutation tool. It covers the basic operation and parameters but lacks details on behavioral traits (e.g., overwrite behavior, error responses) and doesn't explain return values. For a cache set operation, this leaves the agent guessing about outcomes.

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

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 75% (3 of 4 parameters have descriptions), so the baseline is high. The description adds value by clarifying that 'value' can be 'a string or a JSON-serialized object' (schema only says 'Value to store (string or JSON)'), and explains TTL as 'Time-to-live in seconds (optional, omit for no expiry)' which aligns with but slightly enriches the schema. It doesn't cover 'instance_id' beyond what's implied.

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 description clearly states the specific action ('Set a key-value pair'), the target resource ('in a running cache instance'), and distinguishes it from siblings like cache_get (read) and cache_delete (remove). It specifies the value can be a string or JSON-serialized object, adding precision beyond the name.

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

Usage Guidelines3/5

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

The description implies usage for storing data in a cache with optional TTL, but doesn't explicitly state when to use this tool versus alternatives like cache_mset (for multiple keys) or cache_stream_set (for streaming). It mentions TTL as optional but lacks guidance on prerequisites (e.g., instance must exist) or exclusions.

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

Install Server

Other Tools

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/cachly-dev/cachly-mcp'

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