Skip to main content
Glama
Switchboard666

HaloPSA MCP Server

halopsa_list_api_endpoints

Discover available API endpoints in HaloPSA with their paths, methods, and summaries. Use this tool to explore what endpoints are available before retrieving detailed information.

Instructions

List all API endpoints with their paths, methods, and summaries. Use this first to discover available endpoints, then use halopsa_get_api_endpoint_details for full details. Supports pagination.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoOptional category filter (e.g., "Tickets", "Actions", "Clients", "Sites")
limitNoMaximum number of endpoints to return (default: 100)
skipNoNumber of endpoints to skip for pagination (default: 0)

Implementation Reference

  • The primary handler function that loads the swagger.json schema, filters endpoints by optional category, extracts path/method/summary/category, sorts, paginates, and returns structured results with metadata.
    async listApiEndpoints(category?: string, limit: number = 100, skip: number = 0): Promise<any> {
      try {
        // Import the swagger.json directly
        const swaggerModule = await import('./swagger.json');
        const schema = swaggerModule.default || swaggerModule;
        
        const allMatchingEndpoints: any[] = [];
        
        if ((schema as any).paths) {
          Object.entries((schema as any).paths).forEach(([path, pathObj]: [string, any]) => {
            // Filter by category if provided
            if (category) {
              const pathCategory = this.categorizeApiPath(path);
              if (pathCategory.toLowerCase() !== category.toLowerCase()) {
                return;
              }
            }
            
            if (pathObj && typeof pathObj === 'object') {
              const methods: string[] = [];
              let primarySummary = '';
              
              Object.entries(pathObj).forEach(([method, methodObj]: [string, any]) => {
                methods.push(method.toUpperCase());
                if (!primarySummary && methodObj?.summary) {
                  primarySummary = methodObj.summary;
                }
              });
              
              allMatchingEndpoints.push({
                path,
                methods,
                summary: primarySummary,
                category: this.categorizeApiPath(path)
              });
            }
          });
        }
        
        // Sort endpoints by path
        allMatchingEndpoints.sort((a, b) => a.path.localeCompare(b.path));
        
        // Apply pagination
        const paginatedEndpoints = allMatchingEndpoints.slice(skip, skip + limit);
        
        return {
          totalEndpoints: allMatchingEndpoints.length,
          endpoints: paginatedEndpoints,
          returnedCount: paginatedEndpoints.length,
          skipped: skip,
          limited: paginatedEndpoints.length >= limit,
          hasMore: skip + paginatedEndpoints.length < allMatchingEndpoints.length,
          categories: [...new Set(allMatchingEndpoints.map(e => e.category))].sort(),
          message: category ? 
            `Showing ${paginatedEndpoints.length} of ${allMatchingEndpoints.length} endpoints in category "${category}"` :
            `Showing ${paginatedEndpoints.length} endpoints starting from position ${skip}. Total: ${allMatchingEndpoints.length}.`
        };
      } catch (error) {
        throw new Error(`Failed to list API endpoints: ${error}`);
      }
    }
  • Tool schema definition: name, description, and inputSchema specifying optional category filter, limit (default 100), and skip (default 0) parameters.
    {
      name: 'halopsa_list_api_endpoints',
      description: 'List all API endpoints with their paths, methods, and summaries. Use this first to discover available endpoints, then use halopsa_get_api_endpoint_details for full details. Supports pagination.',
      inputSchema: {
        type: 'object',
        properties: {
          category: {
            type: 'string',
            description: 'Optional category filter (e.g., "Tickets", "Actions", "Clients", "Sites")'
          },
          limit: {
            type: 'number',
            description: 'Maximum number of endpoints to return (default: 100)',
            default: 100
          },
          skip: {
            type: 'number',
            description: 'Number of endpoints to skip for pagination (default: 0)',
            default: 0
          }
        }
      }
    },
  • src/index.ts:516-525 (registration)
    MCP server tool registration: switch case handler that extracts parameters from request and delegates execution to HaloPSAClient.listApiEndpoints method.
    case 'halopsa_list_api_endpoints': {
      const { category, limit, skip } = args as any;
      result = await haloPSAClient.listApiEndpoints(category, limit, skip);
      return {
        content: [{
          type: 'text',
          text: JSON.stringify(result, null, 2)
        }]
      };
    }
  • Supporting utility that categorizes API endpoint paths into logical groups (e.g., 'Tickets', 'Actions') for filtering and display purposes.
    private categorizeApiPath(path: string): string {
      const lowerPath = path.toLowerCase();
      
      if (lowerPath.includes('/actions')) return 'Actions';
      if (lowerPath.includes('/ticket')) return 'Tickets';
      if (lowerPath.includes('/agent')) return 'Agents';
      if (lowerPath.includes('/client')) return 'Clients';
      if (lowerPath.includes('/site')) return 'Sites';
      if (lowerPath.includes('/user')) return 'Users';
      if (lowerPath.includes('/asset')) return 'Assets';
      if (lowerPath.includes('/invoice')) return 'Invoicing';
      if (lowerPath.includes('/report')) return 'Reports';
      if (lowerPath.includes('/address')) return 'Addresses';
      if (lowerPath.includes('/appointment')) return 'Appointments';
      if (lowerPath.includes('/project')) return 'Projects';
      if (lowerPath.includes('/contract')) return 'Contracts';
      if (lowerPath.includes('/supplier')) return 'Suppliers';
      if (lowerPath.includes('/product')) return 'Products';
      if (lowerPath.includes('/kb') || lowerPath.includes('/knowledge')) return 'Knowledge Base';
      if (lowerPath.includes('/integration')) return 'Integrations';
      if (lowerPath.includes('/webhook')) return 'Webhooks';
      if (lowerPath.includes('/api')) return 'API Management';
      
      return 'Other';
    }
Behavior4/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. It effectively describes key behaviors: it's a discovery tool for listing endpoints, supports pagination (implying it can handle large result sets), and is non-destructive (implied by 'list'). However, it doesn't specify rate limits, authentication needs, or error handling, which are minor gaps.

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 front-loaded with the core purpose in the first sentence, followed by usage guidance and a key behavioral trait (pagination) in subsequent sentences. Every sentence adds value without redundancy, making it efficient and well-structured.

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

Completeness4/5

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

Given the tool's moderate complexity (listing endpoints with filtering and pagination), no annotations, and no output schema, the description is mostly complete. It covers purpose, usage, and pagination, but lacks details on output format (e.g., structure of returned data) and error cases, which would be helpful for an agent to interpret results correctly.

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

Parameters3/5

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

The input schema has 100% description coverage, providing clear details for all three parameters (category, limit, skip). The description adds no additional parameter semantics beyond what the schema already covers, such as examples or usage nuances. According to the rules, with high schema coverage (>80%), the baseline is 3 even with no param info in the description.

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

Purpose5/5

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

The description clearly states the specific action ('List all API endpoints') and resources involved ('paths, methods, and summaries'), distinguishing it from siblings like halopsa_get_api_endpoint_details (which provides full details) and halopsa_search_api_endpoints (which presumably searches rather than lists all). The verb 'list' is precise and the scope 'all' is explicitly defined.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool ('Use this first to discover available endpoints') and when to use an alternative ('then use halopsa_get_api_endpoint_details for full details'). It also mentions pagination support, which helps in understanding its context for handling large datasets.

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/Switchboard666/halopsa-mcp'

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