Skip to main content
Glama

[draft] Auth: OAuth2.0/OAuth2.0 Get Access Token

draft_auth_oauth2_0_oauth2_0_get_access_token

Exchange an OAuth2 authorization code and client credentials for an access token, enabling authenticated API calls.

Instructions

This endpoint is used to get the access_token

It requires the following secret client credentials to be sent as part of the form body along with the authentication code obtained as part of the redirect_uri from the previous request.

code: xWnkliVQJURqB2x1

grant_type: authorization_code

redirect_uri: https://www.getpostman.com/oauth2/callback

client_id: abc123

client_secret: ssh-secret

If the correct credentials are not passed, the server returns with a 401 Unauthorized response.

(Postman request: [draft] Auth: OAuth2.0/OAuth2.0 Get Access Token | POST https://postman-echo.com/oauth2/token)

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "draft_auth_oauth2_0_oauth2_0_get_access_token"
  }
}

Input Schema

NameRequiredDescriptionDefault
formNoformdata fields

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior4/5

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

With annotations declaring readOnlyHint=false and openWorldHint=true, the description adds real behavioral context: credentials must travel in the form body, they are secret, and bad credentials yield a `401 Unauthorized`. That error behavior is valuable for an agent. It stops short of covering token lifetime, whether the call is idempotent, or what a successful body looks like.

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

Conciseness3/5

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

The purpose is front-loaded in the first line, which is good. But the block-quoted sample body with fabricated credentials is largely redundant with the schema's own default values, costing several lines for little added information. The trailing Postman request annotation is boilerplate noise.

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

Completeness3/5

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

There is no output schema, so the description carries the burden of describing the return value, and it only says it returns an `access_token`. It omits the rest of a typical OAuth2 token response (`token_type`, `expires_in`, refresh token) that an agent needs in order to use the result. The mutation semantics and permission requirements are otherwise adequately covered.

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%, but the schema's own parameter descriptions are pure tautologies ('code', 'client_id', 'grant_type'), so the baseline of 3 is beaten by the description, which explains what each field means in the flow: the code comes from the redirect, `grant_type` is `authorization_code`, and the client credentials are secrets. The worked example also pins down the expected value format for each field.

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?

The description names a specific verb and resource: exchange an authorization code plus client credentials for an `access_token` via the OAuth2 authorization_code grant. That is far more informative than the title's restatement. It does not, however, distinguish itself from the sibling `draft_auth_oauth2_0_oauth2_0_get_resource`, which an agent could easily confuse with this step.

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

Usage Guidelines3/5

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

Usage is implied rather than stated: the description establishes that this is the second step of the flow, following a request that returned an `authentication code` via `redirect_uri`. It lists required inputs, which effectively tells the agent what must be on hand. But there is no explicit when-to-use guidance, no mention of when not to call it, and no routing to sibling token/resource endpoints.

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