Skip to main content
Glama

complete_user_auth

Exchange OAuth2 authorization code for tokens to complete user authentication, with optional state verification to prevent CSRF attacks.

Instructions

Finish OAuth2 user auth by exchanging the authorization code for tokens.

The code is the value of the code query parameter in the URL eBay redirected to after start_user_auth's auth_url. Optionally pass state to verify against what start_user_auth issued (CSRF defense).

Args: code: the authorization code from eBay's redirect URL. state: optional — the state value from the redirect URL. If provided, must match what start_user_auth stored. Mismatch returns a structured refusal payload. host: which configured host to authenticate against. Defaults to config's default_host. Must match the host used in start_user_auth.

Returns: On success: {host, authenticated: true, access_expires_at, refresh_expires_at} On state mismatch: {refused: true, reason: "state_mismatch", host, message: ...}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
stateNo
hostNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses the return format for success and failure (state mismatch refusal payload), and mentions the effect of the optional state parameter. It does not cover rate limits or side effects like token storage, but the main behavioral aspects are covered.

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?

The description is concise with a clear introductory sentence followed by structured args and returns sections. Every sentence adds value, and the front-loaded summary immediately conveys the tool's purpose.

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?

The description covers the primary use case, parameters, and return values. It includes failure cases for state mismatch. However, it could mention other potential errors (e.g., expired code) or more detail about token handling. Still, given the tool's simplicity, it is largely complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% description coverage, but the description thoroughly explains each parameter: 'code' is from eBay's redirect URL, 'state' is optional for CSRF with mismatch handling, and 'host' defaults to config's default. This adds significant meaning beyond the bare schema.

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 completes OAuth2 user auth by exchanging an authorization code for tokens. It uses a specific verb-resource combination and distinguishes itself from its sibling 'start_user_auth' by referencing the previous step.

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?

The description explicitly mentions when to use this tool (after start_user_auth's auth_url redirect) and explains optional state verification for CSRF. It implicitly suggests not to use it before starting auth. However, it does not explicitly list when not to use it or alternative tools.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/acato/ebay-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server