Skip to main content
Glama

create_expense_report

Create new expense reports in Autotask by specifying submitter details, report name, description, and week ending date for accurate expense tracking and reimbursement processing.

Instructions

Create a new expense report

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionNoExpense report description
nameNoExpense report name
submitterIdYesThe resource ID of the submitter
weekEndingDateNoWeek ending date (YYYY-MM-DD format)

Implementation Reference

  • Primary handler implementation that creates an expense report using the Autotask API client (autotask-node). Handles client initialization, API call, logging, and error handling.
    async createExpenseReport(report: Partial<AutotaskExpenseReport>): Promise<number> { const client = await this.ensureClient(); try { this.logger.debug('Creating expense report:', report); const result = await client.expenses.create(report as any); const reportId = (result.data as any)?.id; this.logger.info(`Expense report created with ID: ${reportId}`); return reportId; } catch (error) { this.logger.error('Failed to create expense report:', error); throw error; } }
  • Dispatching handler in the main tool switch statement (callTool method). Maps tool arguments to service parameters and calls AutotaskService.createExpenseReport.
    case 'create_expense_report': result = await this.autotaskService.createExpenseReport({ name: args.name, description: args.description, submitterID: args.submitterId, weekEndingDate: args.weekEndingDate }); message = `Successfully created expense report with ID: ${result}`; break;
  • Tool registration entry in the listTools() method array. Defines the tool name, description, input schema (JSON Schema for validation), and required parameters.
    { name: 'create_expense_report', description: 'Create a new expense report', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Expense report name' }, description: { type: 'string', description: 'Expense report description' }, submitterId: { type: 'number', description: 'The resource ID of the submitter' }, weekEndingDate: { type: 'string', description: 'Week ending date (YYYY-MM-DD format)' } }, required: ['submitterId'] } },
  • JSON Schema definition for the create_expense_report tool input parameters, specifying types, descriptions, and required fields for MCP validation.
    inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Expense report name' }, description: { type: 'string', description: 'Expense report description' }, submitterId: { type: 'number', description: 'The resource ID of the submitter' }, weekEndingDate: { type: 'string', description: 'Week ending date (YYYY-MM-DD format)' } }, required: ['submitterId'] }

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