Skip to main content
Glama
Switchboard666

HaloPSA MCP Server

halopsa_search_api_endpoints

Search HaloPSA API endpoints using keywords to find relevant paths, summaries, and descriptions for integration and data access.

Instructions

Search for API endpoints by keywords. Returns matching endpoints with basic info. Use halopsa_get_api_endpoint_details for full details of specific endpoints. Supports pagination.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query to find endpoints (searches in paths, summaries, descriptions, and tags)
limitNoMaximum number of results to return (default: 50)
skipNoNumber of results to skip for pagination (default: 0)

Implementation Reference

  • Exact implementation of the tool logic: searches HaloPSA OpenAPI swagger.json paths for endpoints matching the query in path, method summary, description, or tags. Returns paginated results with details.
    async searchApiEndpoints(query: string, limit: number = 50, skip: number = 0): Promise<any> {
      try {
        // Import the swagger.json directly
        const swaggerModule = await import('./swagger.json');
        const schema = swaggerModule.default || swaggerModule;
        const matchingEndpoints: any[] = [];
        
        if ((schema as any).paths) {
          Object.entries((schema as any).paths).forEach(([path, pathObj]: [string, any]) => {
            if (pathObj && typeof pathObj === 'object') {
              Object.entries(pathObj).forEach(([method, methodObj]: [string, any]) => {
                // Search in path, summary, description, and tags
                const searchableText = [
                  path,
                  methodObj?.summary || '',
                  methodObj?.description || '',
                  ...(methodObj?.tags || [])
                ].join(' ').toLowerCase();
                
                if (searchableText.includes(query.toLowerCase())) {
                  matchingEndpoints.push({
                    path,
                    method: method.toUpperCase(),
                    summary: methodObj?.summary,
                    description: methodObj?.description,
                    tags: methodObj?.tags
                  });
                }
              });
            }
          });
        }
        
        // Apply pagination
        const paginatedResults = matchingEndpoints.slice(skip, skip + limit);
        
        return {
          query,
          results: paginatedResults,
          returnedCount: paginatedResults.length,
          totalResults: matchingEndpoints.length,
          skipped: skip,
          hasMore: skip + paginatedResults.length < matchingEndpoints.length,
          message: `Found ${matchingEndpoints.length} endpoints matching "${query}". Showing ${paginatedResults.length} starting from position ${skip}.`
        };
      } catch (error) {
        throw new Error(`Failed to search API endpoints: ${error}`);
      }
    }
  • MCP CallToolRequest handler switch case for halopsa_search_api_endpoints: validates input, calls client method, formats response as MCP content.
    case 'halopsa_search_api_endpoints': {
      const { query, limit, skip } = args as any;
      if (!query) {
        throw new Error('Search query is required');
      }
      
      result = await haloPSAClient.searchApiEndpoints(query, limit, skip);
      return {
        content: [{
          type: 'text',
          text: JSON.stringify(result, null, 2)
        }]
      };
    }
  • Tool registration and input schema definition: defines name, description, and JSON schema for parameters (query required, limit/skip optional).
    {
      name: 'halopsa_search_api_endpoints',
      description: 'Search for API endpoints by keywords. Returns matching endpoints with basic info. Use halopsa_get_api_endpoint_details for full details of specific endpoints. Supports pagination.',
      inputSchema: {
        type: 'object',
        properties: {
          query: {
            type: 'string',
            description: 'Search query to find endpoints (searches in paths, summaries, descriptions, and tags)'
          },
          limit: {
            type: 'number',
            description: 'Maximum number of results to return (default: 50)',
            default: 50
          },
          skip: {
            type: 'number',
            description: 'Number of results to skip for pagination (default: 0)',
            default: 0
          }
        },
        required: ['query']
      }
    },
  • src/index.ts:279-281 (registration)
    Registration of all tools list handler, which exposes the halopsa_search_api_endpoints tool via MCP ListToolsRequest.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools };
    });
Behavior3/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It adds useful context beyond basic functionality: it mentions that results include 'basic info' (not full details), supports pagination, and implies a search scope (keywords). However, it lacks details on permissions, rate limits, error handling, or the exact structure of 'basic info', which are gaps for a tool with no annotations.

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 key behavioral details (returns basic info, alternative tool, pagination support) in subsequent sentences. Each sentence adds value without redundancy, making it efficient and well-structured for quick comprehension.

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 (search with pagination), no annotations, and no output schema, the description is reasonably complete. It covers purpose, usage guidelines, and key behaviors (pagination, basic info vs. full details). However, it lacks details on output format or error cases, which could be improved for full completeness in the absence of structured output data.

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 fully documents all parameters (query, limit, skip). The description adds minimal value beyond the schema: it implies the 'query' parameter searches across multiple fields (paths, summaries, etc.), but this is not explicitly stated. With high schema coverage, the baseline is 3, and the description does not significantly enhance parameter understanding.

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 ('Search for API endpoints by keywords') and resource ('API endpoints'), distinguishing it from siblings like 'halopsa_list_api_endpoints' (which likely lists all without search) and 'halopsa_get_api_endpoint_details' (which provides full details for specific endpoints). The verb 'search' is precise and differentiates the tool's function.

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 explicitly provides usage guidance by stating 'Use halopsa_get_api_endpoint_details for full details of specific endpoints', which clearly indicates when to use this tool (for searching) versus an alternative (for getting full details). This direct comparison to a sibling tool enhances decision-making for the AI agent.

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