Skip to main content
Glama

cachly — Explain it once. Every AI knows it.

cache_set

Set a key-value pair in a running cache instance. Overwrites any existing value at the key — not idempotent for new data. Returns "OK" on success; returns an error if the instance_id is invalid or the instance is paused. Value can be a string or a JSON-serialized object. Optionally set a TTL in seconds (omit for no expiry). Use cache_mset instead for setting multiple keys in a single pipeline round-trip. Use cache_stream_set instead for caching LLM token streams (ordered string chunks).

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": {
      "key": "<key>",
      "value": "<value>"
    },
    "name": "cache_set"
  }
}

Input Schema

NameRequiredDescriptionDefault
keyYesCache key
ttlNoTime-to-live in seconds (optional, omit for no expiry)
valueYesValue to store (string or JSON)
org_idNoOptional org ID — also writes the key to the shared org namespace org:{org_id}:sem:{key} with the same TTL
instance_idNoUUID of the cache instance (from list_instances)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/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 burden and does most of it: overwrite semantics, non-idempotency for new data, the literal success token "OK", and the two documented failure modes (invalid instance_id, paused instance). It omits permission/auth requirements and any rate-limit or size limits, which are the remaining gaps for a write tool.

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?

Front-loaded with the core action and overwrite semantics, then failure modes, then sibling routing — a sensible order with no filler sentences. It is slightly dense at six clauses, and "not idempotent for new data" is a marginally confusing phrasing that could be read as contradicting the overwrite statement.

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?

No output schema exists, yet the description states the success return ("OK") and the error conditions, and it points to list_instances for the instance_id. For a simple write tool this is nearly complete; only auth/permission context and payload size limits are unaddressed.

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 coverage is 100%, so the schema already documents all five parameters including the org namespace side-effect. The description adds only modest value beyond it — clarifying that value may be a string or JSON-serialized object and that omitting ttl means no expiry, both of which restate schema text.

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?

Opens with a specific verb+resource: "Set a key-value pair in a running cache instance." It then explicitly differentiates itself from cache_mset (bulk writes) and cache_stream_set (LLM token streams), so an agent can pick the right tool without opening any schema.

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?

Names two concrete alternatives and the exact condition that selects each: multiple keys in one round-trip -> cache_mset, ordered LLM token chunks -> cache_stream_set. It also states when TTL applies (omit for no expiry), leaving little to inference.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.