Skip to main content
Glama
DynamicEndpoints

PayPal MCP

get_userinfo

Retrieve PayPal user account details by providing an identity token to access profile information and account data.

Instructions

Get user info from identity token

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
access_tokenYes

Implementation Reference

  • The implementation of the get_userinfo tool handler within the CallToolRequestSchema switch statement. It validates the access_token argument, calls the PayPal userinfo API, and returns the response.
    case 'get_userinfo': { const args = this.validateTokenParams(request.params.arguments); const response = await axios.get<PayPalIdentityTokenInfo>( 'https://api-m.sandbox.paypal.com/v1/identity/oauth2/userinfo', { headers: { Authorization: `Bearer ${args.access_token}`, 'Content-Type': 'application/json' } } ); return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }] }; }
  • src/index.ts:1096-1106 (registration)
    Registration of the 'get_userinfo' tool in the ListTools response, defining its name, description, and input schema.
    { name: 'get_userinfo', description: 'Get user info from identity token', inputSchema: { type: 'object', properties: { access_token: { type: 'string' } }, required: ['access_token'] } },
  • Helper function to validate the arguments for the get_userinfo tool, ensuring access_token is provided as a string.
    private validateTokenParams(args: unknown): { access_token: string } { if (typeof args !== 'object' || !args || typeof (args as any).access_token !== 'string') { throw new McpError(ErrorCode.InvalidParams, 'Invalid access token'); } return { access_token: (args as any).access_token }; }
  • TypeScript interface defining the structure of the PayPal userinfo API response.
    interface PayPalIdentityTokenInfo { client_id: string; user_id: string; scopes: string[]; }

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/DynamicEndpoints/Paypal-MCP'

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