get-account
Retrieve Fathom Analytics account details to access site statistics, visitor tracking, and aggregated reports through the MCP server.
Instructions
Get Fathom Analytics account information
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get-account"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/account.ts:9-31 (handler)The handler function for the 'get-account' tool. It retrieves the Fathom Analytics account information using the API client and returns a formatted text response, with error handling.
async () => { try { const accountData = await fathomClient.api.account.get(); return { content: [ { type: "text", text: `Account Information:\n\nName: ${accountData.name}\nEmail: ${accountData.email}\nID: ${accountData.id}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Failed to retrieve account information: ${error instanceof FathomApiError ? `${error.status}: ${error.error}` : String(error)}`, }, ], }; } }, - src/tools/account.ts:5-32 (registration)Registration of the 'get-account' tool using server.tool(), including description, empty input schema, and inline handler.
server.tool( "get-account", "Get Fathom Analytics account information", {}, async () => { try { const accountData = await fathomClient.api.account.get(); return { content: [ { type: "text", text: `Account Information:\n\nName: ${accountData.name}\nEmail: ${accountData.email}\nID: ${accountData.id}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Failed to retrieve account information: ${error instanceof FathomApiError ? `${error.status}: ${error.error}` : String(error)}`, }, ], }; } }, ); - src/index.ts:33-33 (registration)Top-level call to registerAccountTool during server setup, passing the MCP server and Fathom API client.
registerAccountTool(server, fathomClient);