update-phase
Update an existing phase's details such as name, dates, status, budget, notes, color, and billing by providing the phase ID and optional fields.
Instructions
Update an existing phase
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| phase_id | Yes | The phase ID (phase_id) | |
| project_id | No | The ID of the project this phase belongs to | |
| name | No | Phase name | |
| start_date | No | Phase start date (YYYY-MM-DD) | |
| end_date | No | Phase end date (YYYY-MM-DD) | |
| status | No | Phase status (0=Draft, 1=Tentative, 2=Confirmed) | |
| notes | No | Phase notes and description | |
| non_billable | No | Non-billable flag (0=billable, 1=non-billable) | |
| color | No | Phase color (hex code) | |
| default_hourly_rate | No | Default hourly rate for this phase | |
| budget_total | No | Total budget for this phase | |
| active | No | Active status (1=active, 0=archived) |
Implementation Reference
- The main handler function for the 'update-phase' tool. It destructures phase_id from params, passes the rest as updateData to floatApi.patch(), and returns the updated phase.
// Update phase export const updatePhase = createTool( 'update-phase', 'Update an existing phase', z.object({ phase_id: z.union([z.string(), z.number()]).describe('The phase ID (phase_id)'), project_id: z.number().optional().describe('The ID of the project this phase belongs to'), name: z.string().optional().describe('Phase name'), start_date: z.string().optional().describe('Phase start date (YYYY-MM-DD)'), end_date: z.string().optional().describe('Phase end date (YYYY-MM-DD)'), status: z.number().optional().describe('Phase status (0=Draft, 1=Tentative, 2=Confirmed)'), notes: z.string().optional().describe('Phase notes and description'), non_billable: z.number().optional().describe('Non-billable flag (0=billable, 1=non-billable)'), color: z.string().optional().describe('Phase color (hex code)'), default_hourly_rate: z.string().optional().describe('Default hourly rate for this phase'), budget_total: z.number().optional().describe('Total budget for this phase'), active: z.number().optional().describe('Active status (1=active, 0=archived)'), }), async (params) => { const { phase_id, ...updateData } = params; const phase = await floatApi.patch(`/phases/${phase_id}`, updateData, phaseSchema); return phase; } ); - The Zod input schema for the update-phase tool, defining all optional updateable fields (project_id, name, start_date, end_date, status, notes, non_billable, color, default_hourly_rate, budget_total, active) plus the required phase_id.
z.object({ phase_id: z.union([z.string(), z.number()]).describe('The phase ID (phase_id)'), project_id: z.number().optional().describe('The ID of the project this phase belongs to'), name: z.string().optional().describe('Phase name'), start_date: z.string().optional().describe('Phase start date (YYYY-MM-DD)'), end_date: z.string().optional().describe('Phase end date (YYYY-MM-DD)'), status: z.number().optional().describe('Phase status (0=Draft, 1=Tentative, 2=Confirmed)'), notes: z.string().optional().describe('Phase notes and description'), non_billable: z.number().optional().describe('Non-billable flag (0=billable, 1=non-billable)'), color: z.string().optional().describe('Phase color (hex code)'), default_hourly_rate: z.string().optional().describe('Default hourly rate for this phase'), budget_total: z.number().optional().describe('Total budget for this phase'), active: z.number().optional().describe('Active status (1=active, 0=archived)'), }), - src/tools/index.ts:93-94 (registration)The 'updatePhase' export is imported from './project-management/phases.js' and included in the legacyTools array at line 251, registering it as an available MCP tool.
createPhase, updatePhase, - src/services/float-api.ts:654-661 (helper)The patch() method on the FloatApi service that the update-phase handler calls internally to make the HTTP 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:171-186 (schema)The phaseSchema Zod schema used to validate the response from the Float API after an update-phase call.
export const phaseSchema = z.object({ phase_id: z.number().optional(), // Float API uses phase_id, not id project_id: z.number(), name: z.string(), start_date: z.string().nullable().optional(), end_date: z.string().nullable().optional(), status: z.number().optional(), // 0 = Draft, 1 = Tentative, 2 = Confirmed notes: z.string().nullable().optional(), non_billable: z.number().nullable().optional(), // 0 = billable, 1 = non-billable color: z.string().nullable().optional(), default_hourly_rate: z.string().nullable().optional(), // String per API docs budget_total: z.number().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' active: z.number().nullable().optional(), // 0 = archived, 1 = active });