Skip to main content
Glama

cache_evaluate

Determine whether a stored HTTP response is fresh enough to serve without revalidation, using RFC 9111 age and freshness rules. Returns serve, revalidate, or miss with rule IDs.

Instructions

Decide whether a stored response may be reused without revalidating. Applies the RFC 9111 age and freshness arithmetic (Date, Age, Cache-Control, Expires, Last-Modified) and returns action serve|revalidate|miss, the age and freshness lifetime in whole seconds, and the rule IDs with their clause references. now is an argument: the cache never reads a clock.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nowYesevaluation instant (YYYY-MM-DDTHH:MM:SSZ or an HTTP-date)
storedYes
request_headersNoheader name -> value
response_headersNoheader name -> value

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYes
reasonsYes
is_freshYes
current_ageYesRFC 9111 section 4.2.3 age, whole seconds
must_revalidateYes
freshness_lifetimeYeswhole seconds
stale_while_revalidate_windowYeswhole seconds; 0 when undeclared

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/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 well: it states the tool is a pure evaluator whose evaluation instant is an argument ('the cache never reads a clock'), which tells the agent the result is deterministic and independent of wall-clock state. It also discloses the exact header classes consumed and the returned action vocabulary. It stops short of explicitly declaring no side effects or network access.

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?

Three dense sentences, no filler. The purpose is front-loaded, followed by the rule set, the return shape, and the key 'now is an argument' caveat that an agent must not miss. Every sentence earns its place.

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?

For a nested-input evaluator with an output schema (so return values needn't be spelled out), the description covers purpose, rule basis, return vocabulary, and the clock-independence constraint. The remaining gap is the missing editorial distinction between stored.headers and response_headers, and no note on error behavior for malformed dates or missing required fields.

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 75%, so the schema already documents now, stored, stored_at, and age; baseline is 3. The description adds value by naming the semantically relevant headers (Date, Age, Cache-Control, Expires, Last-Modified) and stressing that now must be supplied, but request_headers and response_headers themselves get no explanation and the split between stored.headers and response_headers is never clarified.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource: deciding whether a stored response may be reused without revalidating, computed via RFC 9111 age and freshness arithmetic. That is far more precise than a generic 'evaluate cache'. It never distinguishes itself from siblings such as conditional_evaluate or vary_match, so an agent gets no explicit routing help.

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 framing 'Decide whether a stored response may be reused without revalidating' implies the use case (checking cache freshness before serving), but there is no explicit when-to-use, when-not-to-use, or named alternative. An agent must infer that conditional_evaluate handles the conditional-request path instead. Usage is implied, not stated.

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