Skip to main content
Glama
DynamicEndpoints

PayPal MCP

list_products

Retrieve and display all available products from your PayPal account. Use pagination parameters to manage large product lists effectively.

Instructions

List all products

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
page_sizeNo
pageNo

Implementation Reference

  • The handler function for the 'list_products' tool. It validates pagination parameters, constructs a query string, makes a GET request to the PayPal API to list products, and returns the JSON response.
    case 'list_products': {
      const args = this.validatePaginationParams(request.params.arguments);
      const params = new URLSearchParams({
        page_size: args.page_size?.toString() || '10',
        page: args.page?.toString() || '1'
      });
      const response = await axios.get<PayPalResponse>(
        `https://api-m.sandbox.paypal.com/v1/catalogs/products?${params}`,
        { headers }
      );
      return {
        content: [{
          type: 'text',
          text: JSON.stringify(response.data, null, 2)
        }]
      };
    }
  • src/index.ts:1074-1084 (registration)
    Registration of the 'list_products' tool in the listTools response, including name, description, and input schema.
    {
      name: 'list_products',
      description: 'List all products',
      inputSchema: {
        type: 'object',
        properties: {
          page_size: { type: 'number', minimum: 1, maximum: 100 },
          page: { type: 'number', minimum: 1 }
        }
      }
    },
  • Input schema definition for the 'list_products' tool, specifying optional pagination parameters.
    inputSchema: {
      type: 'object',
      properties: {
        page_size: { type: 'number', minimum: 1, maximum: 100 },
        page: { type: 'number', minimum: 1 }
      }
    }
  • Helper function to validate and sanitize pagination parameters (page_size and page) for the list_products tool.
    private validatePaginationParams(args: unknown): { page_size?: number; page?: number } {
      if (typeof args !== 'object' || !args) {
        return {};
      }
    
      const params = args as Record<string, unknown>;
      const validated: { page_size?: number; page?: number } = {};
    
      if (typeof params.page_size === 'number' && params.page_size >= 1 && params.page_size <= 100) {
        validated.page_size = params.page_size;
      }
      if (typeof params.page === 'number' && params.page >= 1) {
        validated.page = params.page;
      }
    
      return validated;
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. 'List all products' implies a read-only operation, but it doesn't specify whether this requires authentication, how data is returned (e.g., format, pagination details beyond schema), or any rate limits. This is a significant gap for a tool with parameters.

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 extremely concise with just three words, front-loaded and zero waste. It efficiently communicates the core action without unnecessary elaboration, making it easy to parse quickly.

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 has 2 parameters with 0% schema coverage, no annotations, and no output schema, the description is incomplete. It doesn't explain the return values, pagination behavior, or any constraints, leaving critical gaps for an AI agent to understand how to invoke it correctly.

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

Parameters1/5

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

The schema description coverage is 0%, meaning parameters 'page_size' and 'page' are undocumented in the schema. The description adds no information about these parameters—it doesn't mention pagination, default values, or how they affect the listing. This fails to compensate for the low coverage.

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

Purpose4/5

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

The description 'List all products' clearly states the verb ('List') and resource ('products'), providing a specific purpose. However, it doesn't differentiate from potential sibling tools like 'create_product' beyond the obvious action difference, lacking explicit scope or filtering distinctions that might exist.

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 offers no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context for listing products (e.g., after creation or for selection), or comparisons to other tools like 'create_product', leaving usage entirely implicit.

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