answer_query
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
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Required. The query to answer. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| answerText | No | The answer to the query. | |
| references | No | 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. |