list_departments
Retrieve all practice departments to organize workflows and access department-specific information within the athenahealth system.
Instructions
List all departments in the practice
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/handlers/tool-handlers.ts:306-332 (handler)The handler function that implements the core logic of the 'list_departments' tool. It fetches departments using the AthenaHealthClient and returns the JSON-formatted result, with error handling.async handleListDepartments(args: any) { try { const departments = await this.client.getDepartments(); return { content: [ { type: 'text' as const, text: JSON.stringify(departments, null, 2), }, ], }; } catch (error: any) { return { content: [ { type: 'text' as const, text: JSON.stringify({ error: 'Failed to list departments', message: error.message || 'Unknown error occurred', details: error.details || error.message, }, null, 2), }, ], }; } }
- src/definitions/tools.ts:104-112 (schema)The tool definition including name, description, and input schema (no required parameters) for 'list_departments'.{ name: 'list_departments', description: 'List all departments in the practice', inputSchema: { type: 'object', properties: {}, required: [], }, },
- src/mcp-server.ts:194-195 (registration)The dispatch case in the MCP server's tool call handler that routes 'list_departments' calls to the ToolHandlers.handleListDepartments method.case 'list_departments': return await this.toolHandlers.handleListDepartments(args);
- src/mcp-server.ts:166-168 (registration)Registration of all tools (including 'list_departments') via the imported toolDefinitions in the ListToolsRequestHandler.this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: toolDefinitions }; });