Skip to main content
Glama

Exchange OAuth Code For Access Token

tiendanube_oauth_exchange_code

Exchange a temporary OAuth authorization code for a permanent access token, including granted scopes and store user ID, to complete Tiendanube/Nuvemshop app authentication.

Instructions

Exchange the temporary OAuth 'code' (received on the app's redirect URL as ?code=...) for the permanent access_token. The response includes access_token, token_type, scope (granted scopes) and user_id — which is the store_id to use as TIENDANUBE_STORE_ID. Tokens do not expire unless the app is uninstalled or the token is rotated. The code is single-use and short-lived. Requires client credentials: pass client_id/client_secret or set TIENDANUBE_CLIENT_ID / TIENDANUBE_CLIENT_SECRET. Does not need a store access token. HTTP: POST https://www.tiendanube.com/apps/authorize/token (or nuvemshop.com.br).

Input Schema

NameRequiredDescriptionDefault
codeYesAuthorization code from the redirect URL
regionNo'tiendanube' (Hispanoamérica) or 'nuvemshop' (Brasil)tiendanube
client_idNoApp client_id (default: env TIENDANUBE_CLIENT_ID)
client_secretNoApp client_secret (default: env TIENDANUBE_CLIENT_SECRET)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.7/5.0
Behavior5/5

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

Adds substantial context beyond the annotations: the code is single-use and short-lived, tokens never expire unless the app is uninstalled or the token rotated, no store token is needed, and credentials can come from env vars. It also discloses the concrete HTTP endpoint and both regional hosts, which the annotations (readOnly=false, idempotent=false, openWorld=true) do not cover.

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?

Five dense sentences, front-loaded with the action and the code source, then response shape, token lifetime, credential requirements, and endpoint. Nothing is redundant with the title or schema.

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?

There is no output schema, and the description compensates by naming the returned fields (access_token, token_type, scope, user_id) and explaining the lifetime of the resulting token. An agent has everything needed to invoke this correctly on the first try.

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 semantics the schema lacks: the 'code' is single-use and short-lived, and the response user_id is the value to use as TIENDANUBE_STORE_ID. The 'region' enum is only obliquely hinted at through the '(or nuvemshop.com.br)' note.

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?

States a specific verb and resource ('Exchange the temporary OAuth code ... for the permanent access_token') and immediately identifies the input source (app redirect URL ?code=...). No sibling tool performs OAuth, and the description makes that scope unmistakable.

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?

Clearly frames the context of use (right after the app redirect hands back a code) and states explicit prerequisites — client credentials required, store access token NOT required. It stops short of naming a when-not-to-use condition or alternative path, but no such sibling exists.

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

Deploy Server

Other Tools