Skip to main content
Glama

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

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

Input Schema (JSON Schema)

{ "properties": { "filter": { "description": "Optional filter to search for specific tables. Example: \"fault\", \"user\", \"ticket\"", "type": "string" } }, "type": "object" }

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 }; });

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