Skip to main content
Glama

Get Item Details

get_item_details

Retrieve the complete structured detail of a Codebeamer work item including project, priority, assignees, timestamps, story points, custom fields, and test steps. Does not include the description.

Instructions

Get the full structured detail of a Codebeamer work item: project, priority, assignees, created/updated timestamps, story points, custom fields and test steps. Description is intentionally omitted — fetch it via get_item.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemIdYesNumeric item (work item) ID

Implementation Reference

  • The async handler function for the 'get_item_details' tool. Calls client.getItem(itemId) and formats the result with formatItemDetails.
    async ({ itemId }) => {
      const item = await client.getItem(itemId);
      return { content: [{ type: "text", text: formatItemDetails(item) }] };
    },
  • Input schema for get_item_details — requires a positive integer itemId.
    inputSchema: {
      itemId: z
        .number()
        .int()
        .positive()
        .describe("Numeric item (work item) ID"),
    },
  • Registration of the 'get_item_details' tool via server.registerTool() inside registerItemDetailTools.
    server.registerTool(
      "get_item_details",
      {
        title: "Get Item Details",
        description:
          "Get the full structured detail of a Codebeamer work item: project, priority, assignees, " +
          "created/updated timestamps, story points, custom fields and test steps. " +
          "Description is intentionally omitted — fetch it via get_item.",
        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: formatItemDetails(item) }] };
      },
    );
  • The formatItemDetails function that formats the full item details: project, priority, assignees, timestamps, story points, custom fields, and test steps.
    export function formatItemDetails(item: CbItem): string {
      const lines: string[] = [
        `## [${item.id}] ${item.name}`,
        "",
        `- **Project:** ${item.project?.name ?? "?"}`,
        `- **Priority:** ${item.priority?.name ?? "?"}`,
        `- **Assigned to:** ${item.assignedTo?.map((u) => u.name).join(", ") || "unassigned"}`,
        `- **Created:** ${item.createdAt ?? "?"} by ${item.createdBy?.name ?? "?"}`,
        `- **Updated:** ${item.updatedAt ?? "?"}`,
      ];
    
      if (item.storyPoints !== undefined) {
        lines.push(`- **Story Points:** ${item.storyPoints}`);
      }
    
      if (item.customFields && item.customFields.length > 0) {
        const isTestStepField = (f: { type?: string }) =>
          f.type === "TestStepsFieldValue" || f.type === "TableFieldValue";
    
        const regularFields = item.customFields.filter((f) => !isTestStepField(f));
        const testStepFields = item.customFields.filter((f) => isTestStepField(f));
    
        if (regularFields.length > 0) {
          lines.push("", "### Custom Fields", "");
          for (const field of regularFields) {
            const vals = field.values as Array<{ id: number; name?: string }> | undefined;
            const displayValue = vals && vals.length > 0
              ? vals.map((v) => v.name ? `[${v.id}] ${v.name}` : String(v.id)).join(", ")
              : formatFieldValue(field.value);
            lines.push(`- **${field.name}:** ${displayValue}`);
          }
        }
    
        for (const field of testStepFields) {
          let steps: CbTestStep[];
    
          if (field.type === "TableFieldValue") {
            const rows = Array.isArray(field.values) ? field.values : [];
            steps = rows.map((row, idx) => {
              const cols = Array.isArray(row)
                ? (row as Array<{ name: string; value: unknown }>)
                : [];
              const action = cols.find((c) => c.name === "Action")?.value;
              const expected = cols.find((c) => c.name === "Expected result")?.value;
              return {
                index: idx,
                actionDescription: typeof action === "string" ? action : undefined,
                expectedResults: typeof expected === "string" ? expected : undefined,
              };
            });
          } else {
            steps = Array.isArray(field.value) ? (field.value as CbTestStep[]) : [];
          }
    
          lines.push("", `### ${field.name}`, "");
          if (steps.length === 0) {
            lines.push("_No test steps defined._");
          } else {
            lines.push("| # | Action | Expected Result |");
            lines.push("|---|--------|-----------------|");
            for (const step of steps) {
              const num = (step.index ?? 0) + 1;
              const action = (step.actionDescription ?? "").replace(/\|/g, "\\|").replace(/\n/g, " ");
              const expected = (step.expectedResults ?? "").replace(/\|/g, "\\|").replace(/\n/g, " ");
              lines.push(`| ${num} | ${action} | ${expected} |`);
            }
          }
        }
      }
    
      return lines.join("\n");
    }
  • The getItem method on CodebeamerClient that fetches a work item by ID from the Codebeamer API.
    getItem(id: number): Promise<CbItem> {
      return this.http.get(`/items/${id}`, { resource: `item ${id}` });
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist, but the description discloses what data is returned (project, priority, custom fields, test steps) and explicitly states what is omitted (description). It implies a safe read operation, though it does not mention permissions or side effects, which are minimal for a retrieval tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with key purpose and explicit omission. No wasted words, and the note about description being omitted is efficient and instructive.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With a single required parameter and no output schema, the description adequately lists the fields returned and explains the relationship to get_item. It is complete for the tool's scope.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema has 100% coverage with a clear description of 'itemId'. The description adds no further parameter details because the schema is already sufficient. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states it gets 'full structured detail of a Codebeamer work item' and lists specific fields (project, priority, etc.). It distinguishes from the sibling 'get_item' by noting that description is intentionally omitted and fetched separately.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides clear guidance on when to use this tool versus 'get_item': use this for full details except description, use get_item for that. This is explicit and directly addresses alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/3KniGHtcZ/codebeamer-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server