Update Project
update_projectUpdate an existing project's name or description using its UUID. Returns the updated project details or an error if the project is not found.
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. Takes UpdateProjectInput, initializes DebuggAI client, calls updateProject API, and returns updated project or NotFound 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 update_project input validation: uuid (required), name and 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 (name: 'update_project') and the ValidatedTool wrapper that ties the schema to 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:44-66 (registration)Registration of update_project in the tools list (unvalidated at line 44, validated at line 66).
buildUpdateProjectTool(), buildDeleteProjectTool(), buildSearchExecutionsTool(), buildCreateProjectTool(), buildCreateTestSuiteTool(), buildSearchTestSuitesTool(), buildDeleteTestSuiteTool(), buildCreateTestCaseTool(), buildUpdateTestCaseTool(), buildDeleteTestCaseTool(), buildRunTestSuiteTool(), buildGetTestSuiteResultsTool(), ]; const validated: ValidatedTool[] = [ buildValidatedTestPageChangesTool(ctx), buildValidatedTriggerCrawlTool(ctx), buildValidatedProbePageTool(), buildValidatedSearchProjectsTool(), buildValidatedSearchEnvironmentsTool(), buildValidatedCreateEnvironmentTool(), buildValidatedUpdateEnvironmentTool(), buildValidatedDeleteEnvironmentTool(), buildValidatedUpdateProjectTool(), - services/index.ts:125-132 (helper)Service-layer method that PATCHes the project via API (DebuggAIServerClient.updateProject).
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); }