Skip to main content
Glama

create_context_cache

Idempotent

Cache large files (>32k tokens) with Gemini to reuse context across multiple turns, reducing processing overhead. Specify file URIs and model version.

Instructions

Create a Gemini context cache for a set of files.

Caching is useful for large files (>32k tokens) used across multiple turns. Model must be an explicit version (e.g., gemini-1.5-flash-001) or a supported alias.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_urisYesGemini File API URIs (from upload_file)
modelNoModel alias or explicit version IDflash
display_nameNoDisplay name for the cache
ttl_secondsNoCache TTL in seconds (default 1 hour)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

Annotations declare idempotentHint and openWorldHint. Description adds context about caching use cases but does not disclose behavior on cache collisions or error conditions. No contradiction.

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?

Very concise, three sentences front-loaded with essential information. No redundant 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?

Covers use case, parameter context, and model requirement. Output schema exists, so return values not needed. Could mention prerequisites like authentication, but overall adequate.

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 coverage is 100% and description adds value by clarifying file_uris source (from upload_file) and model version requirement, which are not fully covered in schema descriptions.

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?

Clearly states the verb 'create' and the resource 'Gemini context cache', with specific context about files. Distinct from sibling tools like delete_context_cache.

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?

Provides guidance on when caching is useful (large files >32k tokens, multiple turns) and model requirements (explicit version or alias). Lacks explicit when-not-to-use or alternatives.

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/tobert/gpal'

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