update-allocation
Modify an allocation's project, person, dates, hours, notes, billable status, task type, or status using its task ID.
Instructions
Update an existing allocation
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"task_id": "<task_id>"
},
"name": "update-allocation"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | The allocation ID (task_id in Float API) | |
| project_id | No | Project ID | |
| people_id | No | Person ID | |
| start_date | No | Allocation start date (YYYY-MM-DD) | |
| end_date | No | Allocation end date (YYYY-MM-DD) | |
| hours | No | Number of hours allocated | |
| notes | No | Allocation notes | |
| billable | No | Billable flag (0=non-billable, 1=billable) | |
| task_type | No | Task type | |
| status | No | Status (numeric) |
Implementation Reference
- The handler function for the update-allocation tool. It accepts a task_id and optional fields (project_id, people_id, start_date, end_date, hours, notes, billable, task_type, status), destructures task_id from the rest, and sends a PATCH request to /tasks/{task_id} via floatApi.
// Update allocation export const updateAllocation = createTool( 'update-allocation', 'Update an existing allocation', z.object({ task_id: z.union([z.string(), z.number()]).describe('The allocation ID (task_id in Float API)'), project_id: z.number().optional().describe('Project ID'), people_id: z.number().optional().describe('Person ID'), start_date: z.string().optional().describe('Allocation start date (YYYY-MM-DD)'), end_date: z.string().optional().describe('Allocation end date (YYYY-MM-DD)'), hours: z.number().optional().describe('Number of hours allocated'), notes: z.string().optional().describe('Allocation notes'), billable: z.number().optional().describe('Billable flag (0=non-billable, 1=billable)'), task_type: z.number().optional().describe('Task type'), status: z.number().optional().describe('Status (numeric)'), }), async (params) => { const { task_id, ...updateData } = params; const allocation = await floatApi.patch(`/tasks/${task_id}`, updateData, allocationSchema); return allocation; } ); - Input schema for update-allocation using zod. Requires task_id, all other fields are optional for partial updates.
z.object({ task_id: z.union([z.string(), z.number()]).describe('The allocation ID (task_id in Float API)'), project_id: z.number().optional().describe('Project ID'), people_id: z.number().optional().describe('Person ID'), start_date: z.string().optional().describe('Allocation start date (YYYY-MM-DD)'), end_date: z.string().optional().describe('Allocation end date (YYYY-MM-DD)'), hours: z.number().optional().describe('Number of hours allocated'), notes: z.string().optional().describe('Allocation notes'), billable: z.number().optional().describe('Billable flag (0=non-billable, 1=billable)'), task_type: z.number().optional().describe('Task type'), status: z.number().optional().describe('Status (numeric)'), }), - src/tools/index.ts:233-237 (registration)updateAllocation is imported from './project-management/allocations.js' and included in the legacyTools array (line 236) which is exported as part of the tools array.
listAllocations, getAllocation, createAllocation, updateAllocation, deleteAllocation, - src/services/float-api.ts:654-661 (helper)The FloatApi.patch method used by the update-allocation handler to make the PATCH request to the Float API.
async patch<T>( url: string, data: unknown, schema?: z.ZodType<T>, format: ResponseFormat = 'json' ): Promise<T> { return this.handleRateLimitRetry(() => this.makeRequest<T>('PATCH', url, data, schema, format)); } - src/types/float.ts:130-145 (schema)The allocation response schema (zod) used to validate the API response from the PATCH request.
export const allocationSchema = z.object({ task_id: z.number().optional(), // Float API uses task_id for allocations project_id: z.number().optional(), people_id: z.number().optional(), // Float API uses people_id, not person_id start_date: z.string().nullable().optional(), end_date: z.string().nullable().optional(), hours: z.number().nullable().optional(), notes: z.string().nullable().optional(), created: z.string().nullable().optional(), // Float API uses 'created', not 'created_at' modified: z.string().nullable().optional(), // Float API uses 'modified', not 'updated_at' billable: z.number().nullable().optional(), // 0 = non-billable, 1 = billable repeat_state: z.number().nullable().optional(), repeat_end: z.string().nullable().optional(), task_type: z.number().nullable().optional(), status: z.number().nullable().optional(), });