Skip to main content
Glama

Exchange Google Health OAuth Code

google_health_exchange_code

Exchange a Google OAuth authorization code for locally stored tokens with secure file permissions. Tokens remain on the machine and are never returned, so explicit user consent is required before calling.

Instructions

Exchange a Google OAuth authorization code for local tokens. Tokens are stored locally with 0600 permissions and are never returned. Gated: requires explicit user intent — agents must not call this autonomously.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesOAuth authorization code, or a full redirect URL containing ?code=...
code_verifierYesPKCE code verifier from google_health_get_auth_url.
response_formatNomarkdown

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
noteYes
scopeNo
expires_atNo
token_pathYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.7.7
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / properties / code_verifier
      Added value: +{
      +  "description": "PKCE code verifier from google_health_get_auth_url.",
      +  "minLength": 1,
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "code"
      -]New value: +[
      +  "code",
      +  "code_verifier"
      +]
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. First observedv0.1.3

TDQS

A4.5/5.0
Behavior5/5

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

The description goes well beyond the annotations by disclosing that tokens are stored locally with 0600 permissions, are never returned, and that the operation is gated on explicit user intent. This is valuable behavioral context for a security-sensitive tool.

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?

The description is three sentences with no filler. The primary purpose is front-loaded, followed by essential behavioral disclosure and a decisive usage constraint. Every sentence earns its place.

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 an OAuth token exchange tool, the description covers the necessary context: what the tool does, where tokens go, what permissions they get, that they are never returned, and that autonomous calls are forbidden. The output schema and parameter schema cover the remaining invocation details.

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?

The schema already documents the two required parameters, code and code_verifier, and the optional response_format has an enum plus default. The description adds no parameter-specific meaning, but the schema covers the important inputs adequately, so the agent can still invoke the tool correctly.

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 uses a specific verb-resource pair: 'Exchange a Google OAuth authorization code for local tokens.' This clearly differentiates it from sibling tools like google_health_get_auth_url and makes the tool's role in the OAuth flow unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states a critical usage restriction: 'requires explicit user intent — agents must not call this autonomously.' It does not name alternative tools, but it gives a clear and strong condition for when the tool must not be used.

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