Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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),
            },
          ],
        };
      }
    }
  • 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: [],
      },
    },
  • 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);
  • Registration of all tools (including 'list_departments') via the imported toolDefinitions in the ListToolsRequestHandler.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools: toolDefinitions };
    });

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/ophydami/Athenahealth-MCP'

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