Skip to main content
Glama
bquigley1

Finix MCP Server

by bquigley1

list_sellers

Retrieve seller information from Finix payment processing services. Filter results by email or limit the number of records returned for efficient data management.

Instructions

This tool will fetch a list of Sellers from Finix.

It takes two arguments:

  • limit (int, optional): The number of sellers to return.

  • email (str, optional): A case-sensitive filter on the list based on the seller's email field.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
emailNo

Implementation Reference

  • The main handler function that implements the list_sellers tool. It queries the Finix identities endpoint with optional limit and email filters, filters the results for sellers (identity_roles includes 'SELLER'), and returns an array of seller IDs.
    const listSellers = async (client: FinixClient, _context: FinixContext, params: any): Promise<any> => {
      try {
        if (!client.hasCredentials()) {
          throw new Error('Finix username and password are required for this operation. Please configure FINIX_USERNAME and FINIX_PASSWORD in your environment.');
        }
    
        const { limit, email } = params;
        
        // Build query parameters  
        const queryParams = new URLSearchParams();
        
        if (limit) queryParams.append('limit', limit.toString());
        if (email) queryParams.append('email', email);
    
        const response = await client.get(`/identities?${queryParams.toString()}`);
        
        if (response.error) {
          throw new Error(`Error listing sellers: ${response.error.message}`);
        }
        
        const data = response.data;
        const identities = data._embedded?.identities || [];
        
        // Filter for sellers only and return just IDs like Stripe
        const sellers = identities
          .filter((identity: any) => identity.identity_roles?.includes('SELLER'))
          .map((seller: any) => ({ id: seller.id }));
        
        return sellers;
    
      } catch (error) {
        throw error;
      }
    };
  • Zod schema defining the input parameters for the list_sellers tool: optional limit (1-100) and email filter.
    const listSellersParameters = () => z.object({
      limit: z.number().int().min(1).max(100).optional().describe(
        'A limit on the number of objects to be returned. Limit can range between 1 and 100.'
      ),
      email: z.string().optional().describe(
        'A case-sensitive filter on the list based on the seller\'s email field. The value must be a string.'
      )
    });
  • Tool factory registration defining the 'list_sellers' method, its name, description, parameters, annotations, permissions, and linking to the execute handler. Exported for use in the tools index.
    const tool: ToolFactory = () => ({
      method: 'list_sellers',
      name: 'List Sellers',
      description: listSellersPrompt(),
      parameters: listSellersParameters(),
      annotations: listSellersAnnotations(),
      actions: {
        identities: {
          read: true
        }
      },
      execute: listSellers
    });
    
    export default tool;
  • Prompt providing the natural language description of the list_sellers tool, used in the tool's description field.
    const listSellersPrompt = () => `
    This tool will fetch a list of Sellers from Finix.
    
    It takes two arguments:
    - limit (int, optional): The number of sellers to return.
    - email (str, optional): A case-sensitive filter on the list based on the seller's email field.
    `;
  • Annotations providing metadata hints for the list_sellers tool such as idempotent, read-only, etc.
    const listSellersAnnotations = () => ({
      destructiveHint: false,
      idempotentHint: true,
      openWorldHint: true,
      readOnlyHint: true,
      title: 'List sellers'
    });

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/bquigley1/finix-mcp'

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