Get Item
get_itemRetrieve a lightweight summary of a Codebeamer work item including ID, name, tracker, status, and description. Identify and read an item's basic information without extra details.
Instructions
Get a lightweight summary of a Codebeamer work item: ID, name, tracker, status and description. Use this when you only need to identify the item and read its description. For priority, assignees, dates, story points, custom fields and test steps, call get_item_details.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| itemId | Yes | Numeric item (work item) ID |
Implementation Reference
- src/tools/items.ts:86-106 (registration)Registration of the 'get_item' tool using the MCP server.registerTool method. Defines input schema (itemId: positive integer) and description.
server.registerTool( "get_item", { title: "Get Item", description: "Get a lightweight summary of a Codebeamer work item: ID, name, tracker, status and description. " + "Use this when you only need to identify the item and read its description. " + "For priority, assignees, dates, story points, custom fields and test steps, call get_item_details.", inputSchema: { itemId: z .number() .int() .positive() .describe("Numeric item (work item) ID"), }, }, async ({ itemId }) => { const item = await client.getItem(itemId); return { content: [{ type: "text", text: formatItemSummary(item) }] }; }, ); - src/tools/items.ts:102-105 (handler)Handler function for the 'get_item' tool. Calls client.getItem(itemId) and formats the result using formatItemSummary.
async ({ itemId }) => { const item = await client.getItem(itemId); return { content: [{ type: "text", text: formatItemSummary(item) }] }; }, - Client method that makes the actual HTTP GET request to /items/{id} to fetch a CbItem.
getItem(id: number): Promise<CbItem> { return this.http.get(`/items/${id}`, { resource: `item ${id}` }); - Formatter function that produces the human-readable summary output for a single item (ID, name, tracker, type, status, description).
export function formatItemSummary(item: CbItem): string { const lines: string[] = [ `## [${item.id}] ${item.name}`, "", `- **Tracker:** ${item.tracker?.name ?? "?"} (ID: ${item.tracker?.id ?? "?"})`, `- **Type:** ${item.categories?.[0]?.name ?? item.typeName ?? "?"}`, `- **Status:** ${item.status?.name ?? "?"}`, ]; const description = typeof item.description === "string" ? item.description : item.description?.value ?? item.description?.markup; if (description) { lines.push("", "### Description", "", description); } return lines.join("\n"); } - src/tools/items.ts:94-100 (schema)Input schema for the 'get_item' tool: itemId must be a positive integer.
inputSchema: { itemId: z .number() .int() .positive() .describe("Numeric item (work item) ID"), },