Skip to main content
Glama

create_task

Create new tasks in Autotask by specifying project ID, title, status, assigned resources, estimated hours, and scheduling details to organize project work.

Instructions

Create a new task in Autotask

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assignedResourceIDNoAssigned resource ID
descriptionNoTask description
endDateTimeNoTask end date/time (ISO format)
estimatedHoursNoEstimated hours for the task
projectIDYesProject ID for the task
startDateTimeNoTask start date/time (ISO format)
statusYesTask status (1=New, 2=In Progress, 5=Complete)
titleYesTask title

Implementation Reference

  • Core handler function that executes the create_task tool logic by calling the autotask-node client's tasks.create() method.
    async createTask(task: Partial<AutotaskTask>): Promise<number> { const client = await this.ensureClient(); try { this.logger.debug('Creating task:', task); const result = await client.tasks.create(task as any); const taskId = (result.data as any)?.id; this.logger.info(`Task created with ID: ${taskId}`); return taskId; } catch (error) { this.logger.error('Failed to create task:', error); throw error; } }
  • Input schema and metadata definition for the create_task tool returned by listTools()
    { name: 'create_task', description: 'Create a new task in Autotask', inputSchema: { type: 'object', properties: { projectID: { type: 'number', description: 'Project ID for the task' }, title: { type: 'string', description: 'Task title' }, description: { type: 'string', description: 'Task description' }, status: { type: 'number', description: 'Task status (1=New, 2=In Progress, 5=Complete)' }, assignedResourceID: { type: 'number', description: 'Assigned resource ID' }, estimatedHours: { type: 'number', description: 'Estimated hours for the task' }, startDateTime: { type: 'string', description: 'Task start date/time (ISO format)' }, endDateTime: { type: 'string', description: 'Task end date/time (ISO format)' } }, required: ['projectID', 'title', 'status'] } }
  • MCP tool dispatch case in AutotaskToolHandler.callTool() that invokes the service layer.
    case 'create_task': result = await this.autotaskService.createTask(args); message = `Successfully created task with ID: ${result}`; break;
  • MCP server registration of listTools and callTool request handlers that delegate to the tool handler providing create_task.
    // List available tools this.server.setRequestHandler(ListToolsRequestSchema, async () => { try { this.logger.debug('Handling list tools request'); const tools = await this.toolHandler.listTools(); return { tools }; } catch (error) { this.logger.error('Failed to list tools:', error); throw new McpError( ErrorCode.InternalError, `Failed to list tools: ${error instanceof Error ? error.message : 'Unknown error'}` ); } }); // Call a tool this.server.setRequestHandler(CallToolRequestSchema, async (request) => { try { this.logger.debug(`Handling tool call: ${request.params.name}`); const result = await this.toolHandler.callTool( request.params.name, request.params.arguments || {} ); return { content: result.content, isError: result.isError }; } catch (error) { this.logger.error(`Failed to call tool ${request.params.name}:`, error); throw new McpError( ErrorCode.InternalError, `Failed to call tool: ${error instanceof Error ? error.message : 'Unknown error'}` ); } });
  • Instantiation of the EnhancedAutotaskToolHandler (extends base handler containing create_task) for use in MCP server.
    this.resourceHandler = new AutotaskResourceHandler(this.autotaskService, logger); this.toolHandler = new EnhancedAutotaskToolHandler(this.autotaskService, logger);

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