Skip to main content
Glama

tollbooth-oauth2-collector

Store Code

store_code

Store a sealed OAuth2 authorization code.

Called by the serverless callback function after the browser redirect. The state carries the patron npub, the operator npub (the PUBLIC key the code is sealed to) and the flow's one-time secret — see the SDK's pack_oauth_state. The code is sealed with NIP-44 to the operator so only that operator's nsec can open it. The Neon row is keyed by oauth_code_key(state) (patron npub + secret), so only the flow that holds the secret finds it: a link someone else built with a patron's npub files its code where that patron's flow never looks.

Input Schema

NameRequiredDescriptionDefault
codeYesThe authorization code from the OAuth provider.
stateYesThe packed state (``patron_npub.operator_npub.secret``).

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 packed state (``patron_npub.operator_npub``)."New value: +"The packed state (``patron_npub.operator_npub.secret``)."
  2. Changed2 schema fields changed
    • addedInput schema / properties / code / description
      Added value: +"The authorization code from the OAuth provider."
    • addedInput schema / properties / state / description
      Added value: +"The packed state (``patron_npub.operator_npub``)."
  3. First observed

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations provided, the description carries the behavioral burden and does well: it explains that the code is sealed with NIP-44 to the operator, that state carries the patron npub, operator npub, and one-time secret, and that the Neon row is keyed in a way that only the correct flow can find it. It does not discuss duplicate-row handling, overwrite behavior, or failure modes, which are the main remaining transparency gaps for a storage operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded in the first sentence, and the remaining sentences add relevant security and storage context. The description is dense and somewhat long, but most of its detail earns its place by explaining the sealing and keying model.

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?

For a security-sensitive write operation with no annotations, the description is substantially complete: it covers purpose, callback usage, sealing, state contents, and row-key isolation. Since the input schema is fully documented and an output schema exists, the main minor omissions are duplicate handling and error behavior rather than core invocation semantics.

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 description coverage is already 100%, so the baseline is 3, but the description adds substantial meaning beyond the schema by explaining what the packed state contains and how it controls sealing and row lookup. It reinforces the security semantics of both parameters rather than merely restating their types.

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 states a specific verb and resource: 'Store a sealed OAuth2 authorization code.' It clearly distinguishes the write-side operation from the sibling retrieve_code tool and explains the callback context in which storage happens.

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?

It gives clear usage context by saying this is called by the serverless callback function after the browser redirect. It does not explicitly name retrieve_code or state when not to use this tool, but the operational context is specific enough for an agent to select it correctly.

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.