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.

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