Skip to main content
Glama

list-sites

Retrieve a comprehensive list of all sites including device counts, WAN status, and ISP information.

Instructions

List all sites with statistics (device counts, WAN status, ISP info)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for 'list-sites' tool. Calls the UniFi API GET /sites and returns the response data.
    export async function listSites() {
      const response = await unifiClient.get<{ data: unknown[] }>("/sites");
      return response.data;
    }
  • Schema definition for 'list-sites' — an empty Zod object (no input parameters required).
    export const listSitesSchema = z.object({});
  • src/index.ts:117-119 (registration)
    Registration of 'list-sites' tool via the local `tool()` helper, which calls `registry.register()` and then `server.tool()` on the MCP server. Category is 'raw'.
    tool("list-sites",
      "List all sites with statistics (device counts, WAN status, ISP info)",
      listSitesSchema.shape, wrapToolHandler(listSites));
  • The wrapToolHandler helper wraps the listSites handler to provide error handling and redaction. Used during registration.
    export const wrapToolHandler = createWrapToolHandler({
      redactionPatterns: [/X-API-KEY/i],
      errorExtractors: [
        {
          match: (error) => error instanceof ConnectorUnavailableError,
          extract: (error) => ({
            kind: "passthrough",
            text: (error as ConnectorUnavailableError).message,
          }),
        },
        {
          match: (error) => error instanceof ConnectorError,
          extract: (error) => {
            const e = error as ConnectorError;
            return {
              kind: "structured",
              data: { message: e.message, status: e.status, details: e.body },
            };
          },
        },
        {
          match: (error) => error instanceof UniFiError,
          extract: (error) => {
            const e = error as UniFiError;
            return {
              kind: "structured",
              data: { message: e.message, status: e.status, details: e.body },
            };
          },
        },
      ],
    });
  • src/index.ts:68-73 (registration)
    The local `tool()` helper function that registers the tool with the registry and (if enabled) on the MCP server.
    function tool(name: string, description: string, schema: any, handler: any): void {
      registry.register(name, description, currentCategory);
      if (registry.isEnabled(currentCategory)) {
        server.tool(name, description, schema, handler);
      }
    }
Behavior3/5

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

No annotations provided. Description implies read-only operation but does not disclose any additional behavioral traits such as pagination, result limits, authentication requirements, or rate limits. Adequate but minimal.

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?

Single sentence, no wasted words. Information is front-loaded and directly conveys the tool's function.

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?

For a simple no-param list tool, the description covers the basic purpose but lacks usage context and behavioral details. Could be more complete given the presence of similar siblings.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters in input schema (0 params, 100% coverage), so baseline is 4. Description does not need to add param details.

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?

Clearly states it lists all sites with statistics (device counts, WAN status, ISP info). Distinguishes from 'list-sites-overview' by specifying the additional statistics provided.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus siblings like 'analyze-site-health', 'get-isp-metrics', or 'list-sites-overview'. No when-not or alternatives mentioned.

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/us-all/unifi-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server