Skip to main content
Glama

gemini_get_result

Retrieve the result of an asynchronous generation using the job_id: reports status while running, returns the completed output on success, or raises the recorded error on failure.

Instructions

Retrieve a generation started with async: true or handed off by max_wait_ms. Pass the returned job_id: while running it reports status "running"; on completion it returns the normal result (image URLs/paths + meta); on failure it raises the recorded error, including the case where the generation was killed before it finished. On the hosted connector job records are stored durably and survive a restart; on a local stdio server they live with the process and expire ~10 min after completion, where the output dir / .json sidecar is the fallback. A killed video/music job started with background: true is recovered from its upstream interaction when it finished there.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
job_idYesThe job_id returned by a generation tool called with async: true
output_dirNoWhere to write media recovered from a killed job (default: $GEMINI_OUTPUT_DIR or cwd)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.0.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. Changed1 schema field changedv1.10.0
    • addedInput schema / properties / output_dir
      Added value: +{
      +  "description": "Where to write media recovered from a killed job (default: $GEMINI_OUTPUT_DIR or cwd)",
      +  "type": "string"
      +}
  3. First observedv1.2.0

TDQS

A4.8/5.0
Behavior5/5

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

Goes far beyond the minimal annotations (readOnlyHint false, openWorldHint true). Discloses status polling, error raising, durability on hosted connector, expiration on local servers, and recovery of killed jobs. This adds substantial behavioral context not inferable from annotations.

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?

The description is longer than average but every sentence contributes essential information. It is front-loaded with the core purpose, then expands on outcomes and storage behavior. No fluff or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a retrieval tool with no output schema, it fully specifies what is returned (image URLs/paths + meta) and what happens on failure (raises recorded error). It also covers lifecycle, persistence, and edge cases. Nothing an agent needs to call it correctly is missing.

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%, so baseline is 3. The description adds context for job_id (returned by a generation tool with async: true) and output_dir (fallback for killed jobs), slightly enriching the schema. Does not fully explain all edge cases but adds meaningful value.

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 action (retrieve) and the specific resource (a generation started with async: true or max_wait_ms), and explains the three possible outcomes (running, success, failure). It is easily distinguished from sibling generation tools by naming the companion relationship.

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?

Explicitly says when to use: to retrieve results of async generations or those handed off by max_wait_ms. It also describes fallback behavior for local stdio servers (output dir sidecar) and recovery for killed background jobs, effectively covering when not to rely solely on this tool.

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