Update Project
update_projectUpdate a project using its UUID. Optionally set a new name or description. Returns updated project data. Returns error if UUID does not exist.
Instructions
Patch a project by UUID. Optional fields: name, description. Returns {updated:true, project:{...simplified resource}}. Returns isError:true + NotFound when uuid doesn't exist.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uuid | Yes | UUID of the project. Required. | |
| name | No | Optional: new name. | |
| description | No | Optional: new description. |
Implementation Reference
- handlers/updateProjectHandler.ts:20-51 (handler)Main handler function for the 'update_project' tool. Receives UpdateProjectInput, calls client.updateProject(), and returns {updated:true, project} on success or a 404 error response.
export async function updateProjectHandler( input: UpdateProjectInput, _context: ToolContext, ): Promise<ToolResponse> { const start = Date.now(); logger.toolStart('update_project', { uuid: input.uuid, patchKeys: Object.keys(input).filter(k => k !== 'uuid'), }); try { const client = new DebuggAIServerClient(config.api.key); await client.init(); try { const project = await client.updateProject(input.uuid, { name: input.name, description: input.description, }); logger.toolComplete('update_project', Date.now() - start); return { content: [{ type: 'text', text: JSON.stringify({ updated: true, project }, null, 2) }], }; } catch (err: any) { if (err?.statusCode === 404 || err?.response?.status === 404) return notFound(input.uuid); throw err; } } catch (error) { logger.toolError('update_project', error as Error, Date.now() - start); throw handleExternalServiceError(error, 'DebuggAI', 'update_project'); } } - types/index.ts:131-136 (schema)Zod schema and TypeScript type for UpdateProjectInput: uuid (required), name (optional, min 1), description (optional).
export const UpdateProjectInputSchema = z.object({ uuid: z.string().uuid(), name: z.string().min(1).optional(), description: z.string().optional(), }).strict(); export type UpdateProjectInput = z.infer<typeof UpdateProjectInputSchema>; - tools/updateProject.ts:7-28 (registration)Builds the Tool definition object with name 'update_project', description, and inputSchema (JSON Schema). Also exports buildValidatedUpdateProjectTool which pairs the schema with the handler.
export function buildUpdateProjectTool(): Tool { return { name: 'update_project', title: 'Update Project', description: DESCRIPTION, inputSchema: { type: 'object', properties: { uuid: { type: 'string', description: 'UUID of the project. Required.' }, name: { type: 'string', description: 'Optional: new name.', minLength: 1 }, description: { type: 'string', description: 'Optional: new description.' }, }, required: ['uuid'], additionalProperties: false, }, }; } export function buildValidatedUpdateProjectTool(): ValidatedTool { const tool = buildUpdateProjectTool(); return { ...tool, inputSchema: UpdateProjectInputSchema, handler: updateProjectHandler }; } - tools/index.ts:24-58 (registration)Tool registry initialization: tools array includes buildUpdateProjectTool(), validated array includes buildValidatedUpdateProjectTool(), both registered in initTools().
export function initTools(ctx: ProjectContext | null): void { const tools: Tool[] = [ buildTestPageChangesTool(ctx), buildTriggerCrawlTool(ctx), buildProbePageTool(), buildSearchProjectsTool(), buildSearchEnvironmentsTool(), buildCreateEnvironmentTool(), buildUpdateEnvironmentTool(), buildDeleteEnvironmentTool(), buildUpdateProjectTool(), buildDeleteProjectTool(), buildSearchExecutionsTool(), buildCreateProjectTool(), ]; const validated: ValidatedTool[] = [ buildValidatedTestPageChangesTool(ctx), buildValidatedTriggerCrawlTool(ctx), buildValidatedProbePageTool(), buildValidatedSearchProjectsTool(), buildValidatedSearchEnvironmentsTool(), buildValidatedCreateEnvironmentTool(), buildValidatedUpdateEnvironmentTool(), buildValidatedDeleteEnvironmentTool(), buildValidatedUpdateProjectTool(), buildValidatedDeleteProjectTool(), buildValidatedSearchExecutionsTool(), buildValidatedCreateProjectTool(), ]; _tools = tools; _validatedTools = validated; toolRegistry.clear(); for (const v of validated) toolRegistry.set(v.name, v); - services/index.ts:125-132 (helper)Service-level updateProject method that PATCHes to api/v1/projects/{uuid}/ with name/description fields.
public async updateProject(uuid: string, patch: { name?: string; description?: string }) { if (!this.tx) throw new Error('Client not initialized — call init() first'); const body: Record<string, any> = {}; if (patch.name !== undefined) body.name = patch.name; if (patch.description !== undefined) body.description = patch.description; const p = await this.tx.patch<any>(`api/v1/projects/${uuid}/`, body); return this.mapProjectDetail(p); }