## Tool: `search_health_docs`

Use this tool to search the official Google Health API developer documentation at developers.google.com/health, including guides, data types, OAuth scopes, endpoints, webhook subscriptions, migration from the Fitbit Web API, codelabs, and the REST and RPC reference. Prefer it over your training data, which can be outdated or incomplete for this API.

This tool returns matched Markdown passages (`content`), page titles (`title`), canonical URLs (`sourceUrl`), and document resource names (`document`) for the most relevant pages. Prefer `search_health_docs` followed by `get_health_docs` when you need complete code samples, full reference tables, or end-to-end tutorial walkthroughs. If the returned passages are not detailed enough to answer the user's question, call `get_health_docs` with the `document` resource name from this tool's output to retrieve the full page Markdown. When you use information from a result, you MUST cite the source by including its `sourceUrl` in your response to the user.

The following code sample shows how to use `curl` to call the `search_health_docs` MCP tool.

| Curl Request |
|---|
| ```bash curl --location 'https://healthdevelopers.googleapis.com/mcp' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "search_health_docs", "arguments": { // Provide these details according to the MCP tool specification. } }, "jsonrpc": "2.0", "id": 1 }' ``` |

## Input Schema

Request message for HealthKnowledgeService.SearchHealthDocs.

### SearchHealthDocsRequest

| JSON representation |
|---|
| ``` { "query": string, "pageSize": integer } ``` |

| Fields ||
|---|---|
| `query` | `string` Required. A question or keywords about the Google Health API, for example "How do I read daily step counts?". Don't include personal or health data. At most 500 characters. |
| `pageSize` | `integer` Optional. The maximum number of document chunks to return. The service may return fewer. If unspecified or 0, at most 5 chunks are returned. The maximum value is 20; values above 20 are coerced to 20. Negative values are rejected. |

## Output Schema

Response message for HealthKnowledgeService.SearchHealthDocs.

### SearchHealthDocsResponse

| JSON representation |
|---|
| ``` { "results": [ { object (`DocumentChunk`) } ] } ``` |

| Fields ||
|---|---|
| `results[]` | ``object (`DocumentChunk`)`` The matching document chunks, most relevant first. Empty when nothing matches. Use `DocumentChunk.document` with `GetHealthDocs` to retrieve the full Markdown content of a page when the excerpt is not detailed enough. |

### DocumentChunk

| JSON representation |
|---|
| ``` { "document": string, "title": string, "sourceUrl": string, "content": string, "id": string } ``` |

| Fields ||
|---|---|
| `document` | `string` The resource name of the document this chunk belongs to. Format: `documents/developers.google.com/health/{path}`. Pass this value in `GetHealthDocsRequest.names` to retrieve the full page. |
| `title` | `string` The title of the document this chunk belongs to, as published. |
| `sourceUrl` | `string` The canonical URL of the published page. It starts with `https://developers.google.com/health/`. Cite it when you use the content. |
| `content` | `string` The matched passage from the page in Markdown. |
| `id` | `string` The identifier of this chunk within its document. |

### Tool Annotations


[Tool annotations](https://modelcontextprotocol.io/specification/latest/schema#toolannotations) are sent to MCP clients to describe the basic risk of a given tool. Most clients treat these hints as untrusted, but they can be used to decide when a confirmation prompt might be sent to a user.


Along with the title string, the following boolean hints are defined as follows:

- `readOnlyHint`: If true, the tool doesn't modify its environment. Default: false.
- `destructiveHint`: If true, then the tool can perform destructive actions. If false, then the tool can only perform additive actions. Default: true.
- `idempotentHint`: If true, then calling the tool repeatedly with the same arguments will have no additional effect on its environment. Default: false.
- `openWorldHint`: If true, then the tool can interact with an 'open world' of external entities. If false, then the tool can only interact with internal entities. For example, a web search tool would be open world, while a memory tool would not be open world.

Destructive Hint: ❌ \| Idempotent Hint: ✅ \| Read Only Hint: ✅ \| Open World Hint: ❌