tacit_list_sites
Discover available building sites to access building data, equipment, and sensor information through the Tacit MCP server.
Instructions
List all building sites the current API key has access to.
Each site represents a physical location (building, campus, warehouse) managed in Tacit. Sites are the top-level container. You need a site ID to query buildings, equipment, points, zones, and systems.
Returns: Array of sites with id, name, address, city, country, timezone.
Use this tool first to discover available sites before querying building data.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/sites.ts:38-74 (handler)The handler function that fetches sites from the API and formats the output for the "tacit_list_sites" tool.
async () => { try { const sites = await restGet<Site[]>("/api/sites/"); if (!sites.length) { return { content: [ { type: "text" as const, text: "No sites found. Your API key may not have access to any sites.", }, ], }; } const lines = [`# Sites (${sites.length})`, ""]; for (const s of sites) { lines.push(`## ${s.name}`); lines.push(`- **ID**: \`${s.id}\``); lines.push(`- **Address**: ${s.address || "N/A"}`); lines.push( `- **Location**: ${[s.city, s.country].filter(Boolean).join(", ") || "N/A"}`, ); lines.push(`- **Timezone**: ${s.timezone}`); lines.push(""); } return { content: [{ type: "text" as const, text: lines.join("\n") }] }; } catch (error) { return { content: [ { type: "text" as const, text: `Error: ${error instanceof Error ? error.message : String(error)}`, }, ], isError: true, }; } }, - src/tools/sites.ts:18-75 (registration)Registration of the "tacit_list_sites" tool within the MCP server.
server.registerTool( "tacit_list_sites", { title: "List Sites", description: `List all building sites the current API key has access to. Each site represents a physical location (building, campus, warehouse) managed in Tacit. Sites are the top-level container. You need a site ID to query buildings, equipment, points, zones, and systems. Returns: Array of sites with id, name, address, city, country, timezone. Use this tool first to discover available sites before querying building data.`, inputSchema: {}, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true, }, }, async () => { try { const sites = await restGet<Site[]>("/api/sites/"); if (!sites.length) { return { content: [ { type: "text" as const, text: "No sites found. Your API key may not have access to any sites.", }, ], }; } const lines = [`# Sites (${sites.length})`, ""]; for (const s of sites) { lines.push(`## ${s.name}`); lines.push(`- **ID**: \`${s.id}\``); lines.push(`- **Address**: ${s.address || "N/A"}`); lines.push( `- **Location**: ${[s.city, s.country].filter(Boolean).join(", ") || "N/A"}`, ); lines.push(`- **Timezone**: ${s.timezone}`); lines.push(""); } return { content: [{ type: "text" as const, text: lines.join("\n") }] }; } catch (error) { return { content: [ { type: "text" as const, text: `Error: ${error instanceof Error ? error.message : String(error)}`, }, ], isError: true, }; } }, );