Skip to main content
Glama

Get Item Relations

get_item_relations

Retrieve all incoming and outgoing associations for a specified item, including dependency, blocking, and derivation links.

Instructions

Get all relations (associations) for a Codebeamer item. Shows incoming and outgoing links like 'depends on', 'blocks', 'derived from', etc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemIdYesNumeric item ID

Implementation Reference

  • The actual handler function for the 'get_item_relations' MCP tool. Calls client.getItemRelations(itemId) and formats the result via formatRelations().
    async ({ itemId }) => {
      const page = await client.getItemRelations(itemId);
      return { content: [{ type: "text", text: formatRelations(page) }] };
    },
  • Registration of the 'get_item_relations' tool on the MCP server, defining its name, title, description, and input schema (itemId).
    server.registerTool(
      "get_item_relations",
      {
        title: "Get Item Relations",
        description:
          "Get all relations (associations) for a Codebeamer item. " +
          "Shows incoming and outgoing links like 'depends on', 'blocks', 'derived from', etc.",
        inputSchema: {
          itemId: z
            .number()
            .int()
            .positive()
            .describe("Numeric item ID"),
        },
      },
      async ({ itemId }) => {
        const page = await client.getItemRelations(itemId);
        return { content: [{ type: "text", text: formatRelations(page) }] };
      },
    );
  • Input schema for the 'get_item_relations' tool: a single required positive integer 'itemId'.
    inputSchema: {
      itemId: z
        .number()
        .int()
        .positive()
        .describe("Numeric item ID"),
    },
  • Client method getItemRelations() that calls the Codebeamer API GET /items/{id}/relations and returns a CbItemRelationsPage.
    // Item details
    getItemRelations(id: number): Promise<CbItemRelationsPage> {
      return this.http.get(`/items/${id}/relations`, {
        resource: `relations for item ${id}`,
      });
    }
  • The formatRelations() helper that formats the CbItemRelationsPage into a human-readable markdown table of outgoing and incoming associations.
    export function formatRelations(page: CbItemRelationsPage): string {
      const outgoing = page.outgoingAssociations ?? [];
      const incoming = page.incomingAssociations ?? [];
      const total = outgoing.length + incoming.length;
    
      if (total === 0) return "_No associations found._";
    
      const lines: string[] = [`## Associations (${total})`];
    
      if (outgoing.length > 0) {
        lines.push("", `### Outgoing (${outgoing.length})`, "", ...relationsTable(outgoing));
      }
      if (incoming.length > 0) {
        lines.push("", `### Incoming (${incoming.length})`, "", ...relationsTable(incoming));
      }
    
      return lines.join("\n");
    }
Behavior2/5

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

No annotations are provided, so the description must fully disclose behavioral traits. It only states that it shows incoming/outgoing links but does not mention authentication, rate limits, data format, or that it is a read-only operation (no side effects).

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

Conciseness4/5

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

Two sentences, no wasted words, front-loaded with the main action. Could be slightly improved by separating examples or adding structure, but overall efficient.

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?

Given the simple tool (1 param, no output schema, no annotations), the description covers the essential purpose and examples. However, it lacks details on output format, error handling, and any constraints, which would be helpful for an agent to fully understand the tool's behavior.

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?

The input schema has 100% coverage for the single parameter 'itemId', with a clear description. The tool description adds no extra meaning beyond 'for a Codebeamer item', which is already implied by the schema context. 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 clearly states the action ('Get all relations'), the resource ('for a Codebeamer item'), and provides concrete examples ('depends on', 'blocks', 'derived from'). It differentiates from sibling tools like get_item (gets the item itself) and create_association (creates relations).

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 use when you need to view relations, but lacks explicit guidance on when not to use this tool, prerequisites, or alternative tools for filtering by relation type. It does not mention that relations cannot be filtered or that it shows all types.

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