Skip to main content
Glama
Switchboard666

HaloPSA MCP Server

halopsa_get_api_endpoint_details

Retrieve detailed API endpoint specifications including parameters, request/response schemas, and examples to understand how to interact with HaloPSA's API after identifying relevant endpoints.

Instructions

Get complete details for specific API endpoints including parameters, request/response schemas, and examples. Use after finding endpoints with halopsa_list_api_endpoints.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathPatternYesPath pattern to match endpoints (e.g., "ticket", "action", "client", "agent")
summaryOnlyNoReturn only basic endpoint information (path, methods, summary) without detailed schemas - ideal for quick API exploration
includeSchemasNoInclude detailed request/response schemas (default: true, set to false to significantly reduce response size)
maxEndpointsNoMaximum number of endpoints to return (default: 10, max: 50) - helps manage response size
includeExamplesNoInclude request/response examples (default: false to keep responses smaller)

Implementation Reference

  • Main handler function implementing the tool logic: loads swagger.json, filters endpoints by pathPattern, applies options for detail level (summary/schemas/examples), limits results, and structures response.
    async getApiEndpointDetails(
      pathPattern: string,
      summaryOnly: boolean = false,
      includeSchemas: boolean = true,
      maxEndpoints: number = 10,
      includeExamples: boolean = false
    ): Promise<any> {
      try {
        // Import the swagger.json directly
        const swaggerModule = await import('./swagger.json');
        const schema = swaggerModule.default || swaggerModule;
    
        const matchingPaths: any = {};
        const pathEntries = Object.entries(schema.paths || {});
        let matchCount = 0;
        
        // Find matching paths and limit results
        for (const [path, pathObj] of pathEntries) {
          if (matchCount >= Math.min(maxEndpoints, 50)) break; // Cap at 50 max
          
          if (path.toLowerCase().includes(pathPattern.toLowerCase())) {
            if (summaryOnly) {
              // Return only basic info for summary mode
              const methods: string[] = [];
              let summary = '';
              
              if (pathObj && typeof pathObj === 'object') {
                Object.entries(pathObj).forEach(([method, methodObj]: [string, any]) => {
                  methods.push(method.toUpperCase());
                  if (!summary && methodObj?.summary) {
                    summary = methodObj.summary;
                  }
                });
              }
              
              matchingPaths[path] = { methods, summary };
            } else {
              // Filter the path object based on options
              const filteredPathObj: any = {};
              
              if (pathObj && typeof pathObj === 'object') {
                Object.entries(pathObj).forEach(([method, methodObj]: [string, any]) => {
                  const filteredMethodObj: any = {
                    summary: methodObj?.summary,
                    description: methodObj?.description,
                    operationId: methodObj?.operationId,
                    tags: methodObj?.tags
                  };
                  
                  if (includeSchemas) {
                    filteredMethodObj.parameters = methodObj?.parameters;
                    filteredMethodObj.requestBody = methodObj?.requestBody;
                    filteredMethodObj.responses = methodObj?.responses;
                  }
                  
                  if (includeExamples && methodObj?.examples) {
                    filteredMethodObj.examples = methodObj.examples;
                  }
                  
                  filteredPathObj[method] = filteredMethodObj;
                });
              }
              
              matchingPaths[path] = filteredPathObj;
            }
            matchCount++;
          }
        }
    
        const result: any = {
          pathPattern,
          matchingPaths,
          matchCount,
          totalMatches: pathEntries.filter(([path]) => 
            path.toLowerCase().includes(pathPattern.toLowerCase())
          ).length,
          limited: matchCount >= Math.min(maxEndpoints, 50)
        };
    
        // Only include components if schemas are requested and not in summary mode
        if (includeSchemas && !summaryOnly && matchCount > 0) {
          // Include only referenced components to reduce size
          result.components = {
            schemas: schema.components?.schemas ? 
              Object.fromEntries(
                Object.entries(schema.components.schemas).slice(0, 20)
              ) : undefined
          };
        }
    
        return result;
      } catch (error) {
        throw new Error(`Failed to fetch HaloPSA API endpoint details: ${error}`);
      }
    }
  • Tool schema definition: name, description, and detailed inputSchema for parameters with descriptions, defaults, and requirements.
    {
      name: 'halopsa_get_api_endpoint_details',
      description: 'Get complete details for specific API endpoints including parameters, request/response schemas, and examples. Use after finding endpoints with halopsa_list_api_endpoints.',
      inputSchema: {
        type: 'object',
        properties: {
          pathPattern: {
            type: 'string',
            description: 'Path pattern to match endpoints (e.g., "ticket", "action", "client", "agent")'
          },
          summaryOnly: {
            type: 'boolean',
            description: 'Return only basic endpoint information (path, methods, summary) without detailed schemas - ideal for quick API exploration',
            default: false
          },
          includeSchemas: {
            type: 'boolean',
            description: 'Include detailed request/response schemas (default: true, set to false to significantly reduce response size)',
            default: true
          },
          maxEndpoints: {
            type: 'number',
            description: 'Maximum number of endpoints to return (default: 10, max: 50) - helps manage response size',
            default: 10
          },
          includeExamples: {
            type: 'boolean',
            description: 'Include request/response examples (default: false to keep responses smaller)',
            default: false
          }
        },
        required: ['pathPattern']
      }
    },
  • src/index.ts:527-546 (registration)
    MCP tool dispatch/registration in switch statement: extracts arguments, validates pathPattern, calls client handler, formats response.
    case 'halopsa_get_api_endpoint_details': {
      const { pathPattern, summaryOnly, includeSchemas, maxEndpoints, includeExamples } = args as any;
      if (!pathPattern) {
        throw new Error('Path pattern is required');
      }
      
      result = await haloPSAClient.getApiEndpointDetails(
        pathPattern,
        summaryOnly,
        includeSchemas,
        maxEndpoints,
        includeExamples
      );
      return {
        content: [{
          type: 'text',
          text: JSON.stringify(result, null, 2)
        }]
      };
    }
Behavior3/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 clearly describes the tool's function and workflow context, but lacks information about potential side effects, authentication requirements, rate limits, or error handling. The description doesn't contradict any annotations (none exist), but doesn't provide comprehensive behavioral context.

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 perfectly concise with just two sentences. The first sentence clearly states the purpose and scope, while the second provides crucial usage guidance. Every word earns its place with no redundancy or unnecessary elaboration.

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

Completeness3/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 (5 parameters, no output schema, no annotations), the description provides adequate but not complete context. It explains the tool's purpose and usage timing well, but lacks information about response format, error conditions, or performance characteristics that would be helpful for an AI agent.

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?

Schema description coverage is 100%, so the input schema already fully documents all 5 parameters. The description doesn't add any parameter-specific information beyond what's in the schema descriptions. This meets the baseline expectation when schema coverage is complete, but doesn't provide additional semantic context.

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 ('Get complete details') and resource ('specific API endpoints'), with explicit mention of what details are included (parameters, schemas, examples). It distinguishes from the sibling tool 'halopsa_list_api_endpoints' by specifying this is for detailed information after using that tool for discovery.

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 after finding endpoints with halopsa_list_api_endpoints'), creating a clear workflow dependency. It also implies when not to use it (e.g., for initial endpoint discovery rather than detailed examination), though it doesn't name all alternatives.

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