Skip to main content
Glama
Switchboard666

HaloPSA MCP Server

halopsa_list_tables

Discover available tables in the HaloPSA database to identify what data can be queried. Use this tool to explore database structure before writing SQL queries.

Instructions

List all available tables in the HaloPSA database by querying sys.tables. Returns a complete list of all tables that can be queried. Use this to discover what data is available before writing queries.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filterNoOptional filter to search for specific tables. Example: "fault", "user", "ticket"

Implementation Reference

  • Main handler logic for the halopsa_list_tables tool: constructs SQL query for sys.tables (with optional filter), executes it via haloPSAClient, extracts and sorts table names, returns formatted JSON response.
    case 'halopsa_list_tables': {
      const { filter } = args as any;
      let sql = 'SELECT Name FROM sys.tables';
      if (filter) {
        const escapedFilter = filter.replace(/'/g, "''");
        sql += ` WHERE LOWER(Name) LIKE '%${escapedFilter.toLowerCase()}%'`;
      }
      
      result = await haloPSAClient.executeQuery(sql);
      
      let tables: string[] = [];
      if (result?.report?.rows && Array.isArray(result.report.rows)) {
        tables = result.report.rows.map((row: any) => row.Name || row.name);
        tables.sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase()));
      }
      
      return {
        content: [{
          type: 'text',
          text: JSON.stringify({
            tables,
            count: tables.length,
            filter: filter || 'none'
          }, null, 2)
        }]
      };
    }
  • Tool schema definition for halopsa_list_tables, including name, description, and inputSchema with optional filter parameter.
    {
      name: 'halopsa_list_tables',
      description: 'List all available tables in the HaloPSA database by querying sys.tables. Returns a complete list of all tables that can be queried. Use this to discover what data is available before writing queries.',
      inputSchema: {
        type: 'object',
        properties: {
          filter: {
            type: 'string',
            description: 'Optional filter to search for specific tables. Example: "fault", "user", "ticket"'
          }
        }
      }
    },
  • src/index.ts:279-281 (registration)
    Tool registration via the listTools request handler that returns the complete tools array containing halopsa_list_tables.
    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. It mentions that it 'Returns a complete list of all tables that can be queried,' which adds some behavioral context about the output. However, it lacks details on permissions, rate limits, or error handling, leaving gaps for a tool with no annotation coverage.

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. Both sentences earn their place by providing essential information without redundancy, making it appropriately sized and efficient.

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 low complexity (1 optional parameter, no output schema, no annotations), the description is mostly complete. It covers purpose, usage, and output intent, but could improve by mentioning any limitations or dependencies, though it's adequate for this context.

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 schema already documents the optional 'filter' parameter with an example. The description does not add any parameter-specific information beyond what's in the schema, such as how the filter is applied or its impact on results, resulting in a baseline score.

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 verb ('List') and resource ('all available tables in the HaloPSA database'), specifying it queries sys.tables. It distinguishes from siblings like halopsa_list_columns (which lists columns) and halopsa_table_info (which provides table details), making the purpose specific and differentiated.

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?

It explicitly states when to use this tool: 'Use this to discover what data is available before writing queries.' This provides clear context for usage, distinguishing it from querying tools like halopsa_query or halopsa_build_query, and implies it's a preliminary step.

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