Skip to main content
Glama

tollbooth-oauth2-collector

Retrieve Code

retrieve_code

Retrieve a stored authorization code (one-time read, auto-deleted).

Called by the originating MCP server to pick up the code after the user has authorized in the browser. Returns the encrypted code which the caller decrypts using the same state token.

Input Schema

NameRequiredDescriptionDefault
stateYesWhere the code was filed: patron npub + the flow's secret (the SDK's ``oauth_code_key`` of the authorization state).

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / state / description
      Previous value: -"The state token (patron npub) used during authorization."New value: +"Where the code was filed: patron npub + the flow's secret\n(the SDK's ``oauth_code_key`` of the authorization state)."
  2. Changed1 schema field changed
    • addedInput schema / properties / state / description
      Added value: +"The state token (patron npub) used during authorization."
  3. First observed

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does much of it: it discloses that the read is one-time and the stored code is auto-deleted, and that the returned value is encrypted and must be decrypted with the same state token. It omits permission/auth requirements and the failure mode when the code is absent or already consumed, which matters for a destructive-on-read operation.

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?

Two short sentences, zero filler, and the most decision-relevant fact (one-time read, auto-deleted) is front-loaded in parentheses. Every clause adds information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists so return-value explanation isn't needed, and the single parameter is fully documented. The remaining gap is failure behavior (already-retrieved or missing code) and any auth prerequisite, which a caller of a self-destructing read would want to know.

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 baseline is 3, but the description adds real meaning: the same state token used to file the code is also the decryption key for the returned payload. That is a semantic detail not spelled out in the schema's field description, which only describes where the code was filed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Retrieve a stored authorization code') plus its defining lifecycle trait ('one-time read, auto-deleted'). It implicitly contrasts with the write-side sibling store_code via 'pick up the code', but never names that sibling explicitly, so the differentiation is inferred rather than stated.

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?

Gives a clear trigger condition: called by the originating MCP server after the user has authorized in the browser. That tells an agent the calling context well. It does not state what to do if the code was already consumed, or what alternative to consult instead (e.g., collector_status), so no explicit exclusions.

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.