Skip to main content
Glama

gemini_createCache

Generates cached content resources for compatible Gemini models to reduce latency and costs for frequently reused prompts. Returns metadata detailing the created cache for efficient reuse.

Instructions

Creates a cached content resource for a compatible Gemini model. Caching can reduce latency and costs for prompts that are reused often. NOTE: Caching is only supported for specific models (e.g., gemini-1.5-flash, gemini-1.5-pro). Returns metadata about the created cache.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentsYesRequired. The content to cache, matching the SDK's Content structure (an array of Parts).
displayNameNoOptional. A human-readable name for the cache.
modelNoOptional. The name/ID of the model compatible with caching (e.g., 'gemini-1.5-flash'). If omitted, the server's default model (from GOOGLE_GEMINI_MODEL env var) will be used.
systemInstructionNoOptional. System instructions to associate with the cache.
ttlNoOptional. Time-to-live for the cache as a duration string (e.g., '3600s' for 1 hour). Max 48 hours.
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses that the tool creates a resource (implying a write operation) and returns metadata, which is useful. However, it lacks details on permissions, error conditions, rate limits, or whether the operation is idempotent. For a creation 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?

The description is front-loaded with the core purpose, followed by benefits and constraints, and ends with the return value. All three sentences earn their place: the first defines the tool, the second explains why to use it, and the third adds critical limitations and output information. No wasted words.

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?

Given the complexity (creation tool with 5 parameters, no annotations, no output schema), the description is reasonably complete. It covers purpose, benefits, model constraints, and return value. However, it lacks details on authentication, error handling, or the structure of returned metadata, which could be important for a creation operation.

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 100%, so the schema already documents all 5 parameters thoroughly. The description does not add any parameter-specific information beyond what the schema provides, such as examples or usage tips. The baseline score of 3 reflects adequate coverage by the schema alone.

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 tool's purpose: 'Creates a cached content resource for a compatible Gemini model.' It specifies the verb ('creates'), resource ('cached content resource'), and target ('compatible Gemini model'). It distinguishes from siblings like gemini_updateCache (updates), gemini_getCache (retrieves), and gemini_listCaches (lists).

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool: 'Caching can reduce latency and costs for prompts that are reused often.' It also specifies constraints: 'Caching is only supported for specific models (e.g., gemini-1.5-flash, gemini-1.5-pro).' However, it does not explicitly mention when NOT to use it or name specific alternatives among siblings, such as gemini_generateContent for non-cached generation.

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

Related 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/bsmi021/mcp-gemini-server'

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