Home / Servers / Square API / obtain_token
ObtainToken
An MCP tool from the Square API server, hosted on mcp.hjlabs.in.
ObtainToken Returns an OAuth access token and refresh token using the authorization_code or refresh_token grant type. When grant_type is authorization_code: - With the code flow, provide code, client_id, and… [POST /oauth2/token]
Name on the gateway: square_api__obtain_token · may change things.
Parameters
| Name | Type | Description |
|---|---|---|
client_id required | string | The Square-issued ID of your application, which is available as the… |
client_secret | string | The secret key for your application, which is available as the **Application… |
code | string | The authorization code to exchange for an OAuth access token. This is the code… |
redirect_uri | string | The redirect URL for your application, which you registered as the **Redirect… |
grant_type required | string | The method used to obtain an OAuth access token. The request must include the… |
refresh_token | string | A valid refresh token used to generate a new OAuth access token. This is a… |
migration_token | string | __LEGACY__ A valid access token (obtained using a Square API version prior to… |
scopes | array | The list of permissions that are explicitly requested for the access token.… |
short_lived | boolean | Indicates whether the returned access token should expire in 24 hours.… |
code_verifier | string | The secret your application generated for the authorization request used to… |
use_jwt | boolean | Indicates whether to use a JWT (JSON Web Token) as the OAuth access token.… |
How to call it
Through the Smart Gateway, any client can run it by name with call_tool, or let the gateway find it with search_tools:
{
"name": "square_api__obtain_token",
"arguments": {
"client_id": "…",
"grant_type": "…"
}
}Or connect the Square API server directly, which lists 308 tools including this one:
claude mcp add --transport http hj-square-api https://mcp.hjlabs.in/mcp/square-api \
--header "Authorization: Bearer YOUR_API_KEY"Try asking
Use the obtaintoken tool with client_id set to ….