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

NameTypeDescription
client_id requiredstringThe Square-issued ID of your application, which is available as the…
client_secretstringThe secret key for your application, which is available as the **Application…
codestringThe authorization code to exchange for an OAuth access token. This is the code…
redirect_uristringThe redirect URL for your application, which you registered as the **Redirect…
grant_type requiredstringThe method used to obtain an OAuth access token. The request must include the…
refresh_tokenstringA valid refresh token used to generate a new OAuth access token. This is a…
migration_tokenstring__LEGACY__ A valid access token (obtained using a Square API version prior to…
scopesarrayThe list of permissions that are explicitly requested for the access token.…
short_livedbooleanIndicates whether the returned access token should expire in 24 hours.…
code_verifierstringThe secret your application generated for the authorization request used to…
use_jwtbooleanIndicates 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:

call_tool arguments
{
  "name": "square_api__obtain_token",
  "arguments": {
    "client_id": "…",
    "grant_type": "…"
  }
}

Or connect the Square API server directly, which lists 308 tools including this one:

Run in your terminal
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 ….

More from Square API