Skip to main content
Glama
mackenly

MCP Fathom Analytics

by mackenly

list-sites

Retrieve all analytics sites from your Fathom Analytics account to manage and monitor website performance data.

Instructions

List all Fathom Analytics sites on the account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoOptional limit on the number of sites to return

Implementation Reference

  • Handler function that executes the 'list-sites' tool logic: fetches sites from Fathom Analytics API, formats the list or handles empty/error cases.
        async ({ limit }) => {
            try {
                const sites = await fathomClient.api.getAllSites(limit);
                
                if (sites.length === 0) {
                    return {
                        content: [
                            {
                                type: "text",
                                text: "No sites found.",
                            },
                        ],
                    };
                }
    
                const sitesText = sites.map(site => 
                    `ID: ${site.id}\nName: ${site.name}\nSharing: ${site.sharing}\nCreated: ${site.created_at}\n`
                ).join("\n---\n\n");
                
                return {
                    content: [
                        {
                            type: "text",
                            text: `Sites (${sites.length}):\n\n${sitesText}`,
                        },
                    ],
                };
            } catch (error) {
                return {
                    content: [
                        {
                            type: "text",
                            text: `Failed to retrieve sites: ${error instanceof FathomApiError ? `${error.status}: ${error.error}` : String(error)}`,
                        },
                    ],
                };
            }
        },
    );
  • Input schema for the 'list-sites' tool, defining an optional positive integer limit using Zod.
        limit: z.number().positive().optional().describe("Optional limit on the number of sites to return")
    },
  • Registration of the 'list-sites' tool via server.tool() call within the registerSitesTool function.
    export function registerSitesTool(server: McpServer, fathomClient: FathomApi): void {
        server.tool(
            "list-sites",
            "List all Fathom Analytics sites on the account",
            {
                limit: z.number().positive().optional().describe("Optional limit on the number of sites to return")
            },
            async ({ limit }) => {
                try {
                    const sites = await fathomClient.api.getAllSites(limit);
                    
                    if (sites.length === 0) {
                        return {
                            content: [
                                {
                                    type: "text",
                                    text: "No sites found.",
                                },
                            ],
                        };
                    }
    
                    const sitesText = sites.map(site => 
                        `ID: ${site.id}\nName: ${site.name}\nSharing: ${site.sharing}\nCreated: ${site.created_at}\n`
                    ).join("\n---\n\n");
                    
                    return {
                        content: [
                            {
                                type: "text",
                                text: `Sites (${sites.length}):\n\n${sitesText}`,
                            },
                        ],
                    };
                } catch (error) {
                    return {
                        content: [
                            {
                                type: "text",
                                text: `Failed to retrieve sites: ${error instanceof FathomApiError ? `${error.status}: ${error.error}` : String(error)}`,
                            },
                        ],
                    };
                }
            },
        );
    }
  • src/index.ts:34-34 (registration)
    Top-level call to register the sites tool during MCP server setup.
    registerSitesTool(server, fathomClient);
Behavior2/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 states the action ('List all...') but doesn't disclose behavioral traits like pagination, rate limits, authentication requirements, or what happens if no sites exist. For a list operation with zero annotation coverage, this is a significant gap in transparency.

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 a single, efficient sentence that directly states the tool's purpose with zero wasted words. It is appropriately sized and front-loaded, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a list operation with no annotations and no output schema, the description is incomplete. It lacks details on return values, error handling, or behavioral constraints, which are crucial for an agent to use the tool effectively in 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?

The schema description coverage is 100%, with the single parameter 'limit' fully documented in the schema. The description adds no additional meaning about parameters, such as default behavior or format details, so it meets the baseline for high schema coverage without compensating value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/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 Fathom Analytics sites on the account'), making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'get-account' or 'get-aggregation', which might also retrieve account-related data, so it misses full sibling distinction.

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?

The description provides no guidance on when to use this tool versus alternatives like 'get-account' or 'list-events'. It lacks context on prerequisites, such as authentication needs, or exclusions, leaving the agent with minimal usage direction.

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/mackenly/mcp-fathom-analytics'

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