Skip to main content
Glama
asachs01

Autotask MCP Server

get_expense_report

Retrieve a specific expense report by its ID to access detailed expense information and track spending within the Autotask PSA system.

Instructions

Get a specific expense report by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
reportIdYesThe expense report ID to retrieve

Implementation Reference

  • Core handler function that executes the logic to retrieve an expense report by ID using the AutotaskClient's expenses.get method.
    async getExpenseReport(id: number): Promise<AutotaskExpenseReport | null> {
      const client = await this.ensureClient();
      
      try {
        this.logger.debug(`Getting expense report with ID: ${id}`);
        const result = await client.expenses.get(id);
        return result.data as unknown as AutotaskExpenseReport || null;
      } catch (error) {
        this.logger.error(`Failed to get expense report ${id}:`, error);
        throw error;
      }
    }
  • Tool schema definition including input schema (reportId: number) and registration in the listTools() array.
    {
      name: 'get_expense_report',
      description: 'Get a specific expense report by ID',
      inputSchema: {
        type: 'object',
        properties: {
          reportId: {
            type: 'number',
            description: 'The expense report ID to retrieve'
          }
        },
        required: ['reportId']
      }
    },
  • Tool dispatch/registration in the callTool method's switch statement, invoking the service handler.
    case 'get_expense_report':
      result = await this.autotaskService.getExpenseReport(args.reportId);
      message = `Expense report retrieved successfully`;
      break;

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/asachs01/autotask-mcp'

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