Skip to main content
Glama

List Tracker Items

list_tracker_items

Retrieve a paginated list of items from a Codebeamer tracker, including IDs, summaries, statuses, and priorities.

Instructions

List all items in a specific Codebeamer tracker with pagination. Returns a table with item IDs, summaries, statuses, and priorities.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
trackerIdYesNumeric tracker ID
pageNoPage number (starts at 1)
pageSizeNoItems per page (max 50)

Implementation Reference

  • The actual handler/implementation that calls the Codebeamer API to list tracker items. It first tries the /items/query endpoint with a cbQL filter, and if empty, falls back to /trackers/{trackerId}/items for debug information.
    async listTrackerItems(
      trackerId: number,
      page: number,
      pageSize: number,
    ): Promise<{ items: CbItem[]; debug?: string }> {
      const raw = await this.http.get<unknown>("/items/query", {
        params: { queryString: `tracker.id IN (${trackerId})`, page, pageSize },
        resource: `items for tracker ${trackerId}`,
      });
      const items = toArray<CbItem>(raw);
      if (items.length > 0) return { items };
    
      // Items empty — also try the direct endpoint so we can show raw debug info
      let rawDirect: unknown;
      try {
        rawDirect = await this.http.get<unknown>(`/trackers/${trackerId}/items`, {
          params: { page, pageSize },
          resource: `items for tracker ${trackerId} (direct)`,
        });
      } catch {
        rawDirect = null;
      }
      const rawObj = raw as Record<string, unknown> | null;
      const directObj = rawDirect as Record<string, unknown> | null;
      const queryTotal = rawObj?.["total"] ?? "?";
      const directTotal = directObj?.["total"] ?? "?";
      const directItems = toArray<CbItem>(rawDirect);
      const debug =
        `API vrátilo total=${queryTotal} pro cbQL query a total=${directTotal} pro přímý endpoint.\n` +
        `Pokud je total=0, Codebeamer říká že tam žádné itemy nejsou (špatný tracker ID, chybí oprávnění nebo prázdný tracker).\n` +
        `query: ${JSON.stringify(raw).slice(0, 300)}\n` +
        `direct: ${JSON.stringify(rawDirect).slice(0, 300)}`;
      return { items: directItems, debug };
    }
  • The tool registration using server.registerTool() with the name 'list_tracker_items', input schema, and handler callback.
    server.registerTool(
      "list_tracker_items",
      {
        title: "List Tracker Items",
        description:
          "List all items in a specific Codebeamer tracker with pagination. " +
          "Returns a table with item IDs, summaries, statuses, and priorities.",
        inputSchema: {
          trackerId: z
            .number()
            .int()
            .positive()
            .describe("Numeric tracker ID"),
          page: z
            .number()
            .int()
            .min(1)
            .default(1)
            .describe("Page number (starts at 1)"),
          pageSize: z
            .number()
            .int()
            .min(1)
            .max(50)
            .default(25)
            .describe("Items per page (max 50)"),
        },
      },
      async ({ trackerId, page, pageSize }) => {
        const { items, debug } = await client.listTrackerItems(trackerId, page, pageSize);
        let text = formatItemList(items);
        if (items.length === 0 && debug) {
          text += `\n\n---\n**Debug (raw API responses):**\n\`\`\`\n${debug}\n\`\`\``;
        }
        return { content: [{ type: "text", text }] };
      },
    );
  • Input schema for list_tracker_items: trackerId (positive int), page (min 1, default 1), pageSize (min 1, max 50, default 25). All defined using Zod.
    inputSchema: {
      trackerId: z
        .number()
        .int()
        .positive()
        .describe("Numeric tracker ID"),
      page: z
        .number()
        .int()
        .min(1)
        .default(1)
        .describe("Page number (starts at 1)"),
      pageSize: z
        .number()
        .int()
        .min(1)
        .max(50)
        .default(25)
        .describe("Items per page (max 50)"),
    },
  • toArray helper used by listTrackerItems to normalize API responses (handles both arrays and paginated objects with 'items' or 'itemRefs' keys).
    function toArray<T>(response: unknown): T[] {
      if (Array.isArray(response)) return response as T[];
      if (response && typeof response === "object") {
        const obj = response as Record<string, unknown>;
        if (Array.isArray(obj["items"])) return obj["items"] as T[];
        if (Array.isArray(obj["itemRefs"])) return obj["itemRefs"] as T[];
        // Generic fallback: find first array-valued key
        for (const key of Object.keys(obj)) {
          if (Array.isArray(obj[key])) {
            console.error(`[codebeamer-mcp] Using response key "${key}" instead of "items"`);
            return obj[key] as T[];
          }
        }
        console.error("[codebeamer-mcp] No array found in response:", JSON.stringify(obj).slice(0, 300));
      }
      return [];
    }
  • Top-level registration entry point where registerItemTools is called at server startup.
    registerProjectTools(server, client);
    registerTrackerTools(server, client);
    registerItemTools(server, client);
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions listing and pagination but omits behavioral traits like authentication requirements, rate limits, or whether all items are returned regardless of permissions. Minimal disclosure.

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, clear and to the point, with no unnecessary words. Every part adds value.

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

Completeness3/5

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

No output schema exists, so the description partly compensates by stating return fields. However, it lacks details on pagination behavior (e.g., total count), error handling, or the exact format of the returned table. Adequate but could be more thorough.

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?

Schema description coverage is 100%, so baseline is 3. The description adds no significant meaning beyond what the schema provides, though it does mention the return fields which are not parameters.

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 clearly indicates the tool lists items in a Codebeamer tracker with pagination and specifies returned fields. It distinguishes from siblings like list_trackers (lists trackers) and search_items (searches items).

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

Usage Guidelines3/5

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

The description implies usage when needing to list items by tracker ID but does not provide explicit guidance on when to use it versus alternative tools such as search_items for filtering or get_item for a single item.

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