Get Project
get_projectFetch full project details from Codebeamer by providing the project's numeric ID. Returns all relevant project data for integration or review.
Instructions
Get full details for a single Codebeamer project by its numeric ID.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | Numeric Codebeamer project ID |
Implementation Reference
- src/tools/projects.ts:57-61 (handler)The handler function that executes the 'get_project' tool logic. It calls client.getProject(projectId) and formats the result.
async ({ projectId }) => { const project = await client.getProject(projectId); return { content: [{ type: "text", text: formatProject(project) }] }; }, ); - src/tools/projects.ts:49-55 (schema)Input schema for 'get_project': defines a required 'projectId' positive integer.
inputSchema: { projectId: z .number() .int() .positive() .describe("Numeric Codebeamer project ID"), }, - src/tools/projects.ts:43-61 (registration)Registration of the 'get_project' tool via server.registerTool() within registerProjectTools().
server.registerTool( "get_project", { title: "Get Project", description: "Get full details for a single Codebeamer project by its numeric ID.", inputSchema: { projectId: z .number() .int() .positive() .describe("Numeric Codebeamer project ID"), }, }, async ({ projectId }) => { const project = await client.getProject(projectId); return { content: [{ type: "text", text: formatProject(project) }] }; }, ); - Helper formatter that converts a CbProject object into a formatted markdown string for display.
export function formatProject(project: CbProject): string { const lines: string[] = [ `## ${project.name}`, "", `- **ID:** ${project.id}`, `- **Key:** ${project.keyName ?? "-"}`, `- **Status:** ${project.closed ? "Closed" : "Open"}`, ]; if (project.category) { lines.push(`- **Category:** ${project.category}`); } if (project.description) { lines.push("", "### Description", "", project.description); } if (project.createdAt) { lines.push(`- **Created:** ${project.createdAt}`); } return lines.join("\n"); } - Client method getProject() that sends a GET request to /projects/{id} to fetch a project from the API.
getProject(id: number): Promise<CbProject> { return this.http.get(`/projects/${id}`, { resource: `project ${id}` }); }