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[];
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It implies a read operation ('Get') but doesn't disclose behavioral traits like authentication needs (beyond the token parameter), rate limits, error conditions, or what happens if the token is invalid. The description is minimal and lacks essential operational details.

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 a single, efficient sentence with no wasted words. It's front-loaded with the core action ('Get user info') and adds necessary context ('from identity token'). Every part earns its place, making it highly concise and well-structured.

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

Completeness2/5

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

Given the tool's complexity (simple read operation) but lack of annotations and output schema, the description is incomplete. It doesn't explain what 'user info' returns, error handling, or token validation. For a tool with no structured support, more context is needed to be fully helpful.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate. It mentions 'identity token' which loosely relates to the 'access_token' parameter, but doesn't explain the parameter's semantics (e.g., format, source, or how it's used). No additional meaning is provided beyond the schema's basic type information.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool's purpose ('Get user info') and the source ('from identity token'), which is clear but vague. It doesn't specify what 'user info' includes or how it differs from sibling tools, which are all unrelated to user info (e.g., create_invoice, get_dispute). The verb 'Get' is generic but appropriate.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a valid token), exclusions, or context for usage. With sibling tools focused on payments and disputes, this tool stands alone, but no explicit usage context is given.

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

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