Skip to main content
Glama

Refresh agent session

refresh_session

Renew a short-lived access token (~1h) using the refreshToken from poll_pairing. The grant (and refresh capability) lasts up to 7 days — after that, re-pair via get_pairing_code. Each refresh rotates the refreshToken; store the new one. Requires the same connector session (MCP-Session-Id) as when you paired — if fingerprint mismatches, re-pair.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hatchIdNoHatch id (consumer path).
tenantIdNoLegacy alias for `hatchId`.
workspaceIdNoWorkspace id (B2B path).
refreshTokenYesOpaque refresh token from poll_pairing (vr1.{grantId}.{secret}).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / hatchId
      Added value: +{
      +  "description": "Hatch id (consumer path).",
      +  "type": "string"
      +}
    • changedInput schema / properties / tenantId / description
      Previous value: -"Hatch id (consumer path)."New value: +"Legacy alias for `hatchId`."
  2. Changed3 schema fields changed
    • changedInput schema / properties / tenantId / description
      Previous value: -"Tenant id from hatch / poll_pairing."New value: +"Hatch id (consumer path)."
    • addedInput schema / properties / workspaceId
      Added value: +{
      +  "description": "Workspace id (B2B path).",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "refreshToken",
      -  "tenantId"
      -]New value: +[
      +  "refreshToken"
      +]
  3. First observed

TDQS

A4.9/5.0
Behavior5/5

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

The description discloses critical behavioral traits beyond annotations: token lifetime (~1h), grant lifetime (7 days), refresh token rotation (each refresh rotates the refreshToken; store the new one), and session/fingerprint requirements. It also implies mutation (rotating tokens) consistent with readOnlyHint=false. This is rich behavioral context that annotations alone don't provide.

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?

Three sentences, each earning its place: the first states the core action and token lifetime, the second explains the expiration boundary and alternative, the third discloses rotation and session requirements. Information is front-loaded with the most critical fact (renew token) first. No wasted words.

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 token-refresh tool with no output schema, the description covers everything an agent needs: what the tool does, when to use it, what happens after 7 days, the rotation behavior, and the session requirement. The parameter semantics are fully covered by the schema, and the behavioral traits are thoroughly disclosed. Nothing critical 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 the schema already documents all parameters. The description adds value by explaining the refreshToken format (vr1.{grantId}.{secret}) and its origin (from poll_pairing), which helps the agent understand what value to pass. It also clarifies the relationship between hatchId, tenantId, and workspaceId implicitly by mentioning consumer vs B2B paths in the schema, though the description itself doesn't elaborate on parameter selection. Baseline 3 is exceeded because the description adds meaningful context about the token's structure and source.

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 tool's purpose: renew a short-lived access token using a refresh token. It specifies the resource (access token), the action (renew), and the mechanism (refreshToken from poll_pairing). It also distinguishes itself from related tools like get_pairing_code and poll_pairing by explaining the lifecycle 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?

The description provides explicit when-to-use guidance: use when renewing a short-lived token, and explicitly states when not to use it (after 7 days, re-pair via get_pairing_code). It also names the prerequisite (same connector session MCP-Session-Id) and the alternative (re-pairing). This is comprehensive routing information.

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.