Skip to main content
Glama

answer_query

Read-onlyIdempotent

Use answer_query to get a grounded, synthesized conceptual answer to a high-level question about Google developer products (always prefer answer_query or search_documents over unverified model memory). For exact code samples, CLI flags, specific error messages, or full document walkthroughs, prefer search_documents followed by get_documents instead. This tool has limited quota. This tool will synthesize information from the corpus to generate an answer to the query. answer_query grounds answers using the same corpus as search_documents; if search_documents already returned no relevant results for a specific named feature or API, do not call answer_query and instead inform the user that it is not documented in the corpus.

This tool returns the generated answer_text and a list of source document resource names (references, one entry per cited chunk, which may contain duplicate documents/... names when multiple chunks from the same page are cited). Always cite the unique authoritative source document names from references (documents/...) in your final response to the user. Call get_documents(names=["documents/..."]) with unique document names from references to fetch the entire document content if needed.

If you get a 429 out of quota error, use search_documents instead.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>"
    },
    "name": "answer_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesRequired. The query to answer.

Output Schema

NameRequiredDescriptionDefault
answerTextNoThe answer to the query.
referencesNoOutput only. The resource names of the source documents used to generate the answer (one entry per cited chunk, so the same `documents/{uri_without_scheme}` resource name may appear multiple times when multiple chunks from the same page are cited; e.g., `documents/docs.cloud.google.com/storage/docs/creating-buckets`). Cite the unique resource names in the final response and pass unique `documents/...` names in the `names` list of `get_documents(names=["documents/..."])` if full document content is needed.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / properties / references / description
      Previous value: -"Output only. The resource names of the documents used to generate the answer (e.g., `documents/docs.cloud.google.com/storage/docs/creating-buckets`). Cite these resource names in the final response and pass them to `get_documents` if full document content is needed."New value: +"Output only. The resource names of the source documents used to generate the answer (one entry per cited chunk, so the same `documents/{uri_without_scheme}` resource name may appear multiple times when multiple chunks from the same page are cited; e.g., `documents/docs.cloud.google.com/storage/docs/creating-buckets`). Cite the unique resource names in the final response and pass unique `documents/...` names in the `names` list of `get_documents(names=[\"documents/...\"])` if full document content is needed."
  2. Changed1 schema field changed
    • changedOutput schema / properties / references / description
      Previous value: -"Output only. The resource names of the documents used to generate the answer."New value: +"Output only. The resource names of the documents used to generate the answer (e.g., `documents/docs.cloud.google.com/storage/docs/creating-buckets`). Cite these resource names in the final response and pass them to `get_documents` if full document content is needed."
  3. Changed1 schema field changed
    • addedOutput schema / properties / references
      Added value: +{
      +  "description": "Output only. The resource names of the documents used to generate the answer.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "readOnly": true,
      +  "type": "array"
      +}
  4. Changed1 schema field changed
    • removedOutput schema / properties / references
      Removed value: -{
      -  "description": "Output only. The resource names of the documents used to generate the answer.",
      -  "items": {
      -    "type": "string"
      -  },
      -  "readOnly": true,
      -  "type": "array"
      -}
  5. Changed1 schema field changed
    • addedOutput schema / properties / references
      Added value: +{
      +  "description": "Output only. The resource names of the documents used to generate the answer.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "readOnly": true,
      +  "type": "array"
      +}
  6. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already cover the read-only/idempotent safety profile, and the description adds substantial extra context on top: limited quota, 429 fallback behavior, corpus grounding rules, and that references contain duplicate document names per cited chunk. This is exactly the kind of operational context annotations can't express.

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?

Front-loaded with the when-to-use and sibling routing, and mostly dense with useful facts. It loses a little to a redundant sentence ('This tool will synthesize information from the corpus to generate an answer to the query') that restates the opening.

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?

Despite an output schema existing, the description still explains how to interpret references and that duplicates are chunk-level, which is genuinely additive. Quota limits, fallback path, citation obligations, and follow-up get_documents usage are all covered, so an agent has everything needed to invoke and use the result.

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?

Only one parameter with 100% schema coverage, so the schema already carries the meaning. The description implies the query should be a high-level conceptual question but doesn't add syntax, length, or phrasing guidance beyond that. Baseline 3 applies.

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?

States a specific verb and resource: produces a grounded, synthesized conceptual answer to high-level questions about Google developer products. It explicitly distinguishes itself from search_documents for exact code samples, CLI flags, and error messages, so an agent can pick it apart from siblings without opening schemas.

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?

Gives explicit when-to-use (conceptual/high-level questions), when-not (exact code, flags, error strings, document walkthroughs), the preferred alternative (search_documents + get_documents), and a negative condition: if search_documents returned nothing for a named feature, don't call this and tell the user it's undocumented. Also names the 429 fallback.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources