Skip to main content
Glama

Create Harm

create_harm

Create a new harm item in a Codebeamer Harms List tracker. Set the IMDRF code and severity level (1–5) to document potential harms.

Instructions

Create a new item in a Codebeamer RM Harms List tracker. Supports setting the IMDRF code (text) and Severity (integer 1–5). Use list_trackers to find the Harms List tracker ID for your project.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
trackerIdYesNumeric tracker ID of the RM Harms List tracker
nameYesHarm name / summary
descriptionNoHarm description (plain text or wiki markup)
imdrfCodeNoIMDRF code for this harm (e.g. 'E0001')
severityNoSeverity level (integer 1–5)
parentIdNoParent item ID to nest this harm inside (e.g. a folder)

Implementation Reference

  • The async handler function that executes the 'create_harm' tool logic. It builds customFields for IMDRF code (fieldId 10000) and severity (fieldId 10001), then calls client.createItem() and formats the result.
      async ({ trackerId, name, description, imdrfCode, severity, parentId }) => {
        const customFields: Array<{ fieldId: number; type: string; value: unknown }> = [];
    
        if (imdrfCode !== undefined) {
          customFields.push({ fieldId: 10000, type: "TextFieldValue", value: imdrfCode });
        }
        if (severity !== undefined) {
          customFields.push({ fieldId: 10001, type: "IntegerFieldValue", value: severity });
        }
    
        const data = {
          name,
          ...(description !== undefined ? { description } : {}),
          ...(customFields.length > 0 ? { customFields } : {}),
        };
    
        const item = await client.createItem(trackerId, data, parentId);
        return { content: [{ type: "text", text: formatItem(item) }] };
      },
    );
  • Input schema for 'create_harm' using Zod: trackerId (positive int), name (required string), description (optional), imdrfCode (optional string), severity (optional int 1-5), parentId (optional positive int).
    inputSchema: {
      trackerId: z
        .number()
        .int()
        .positive()
        .describe("Numeric tracker ID of the RM Harms List tracker"),
      name: z.string().min(1).describe("Harm name / summary"),
      description: z
        .string()
        .optional()
        .describe("Harm description (plain text or wiki markup)"),
      imdrfCode: z
        .string()
        .optional()
        .describe("IMDRF code for this harm (e.g. 'E0001')"),
      severity: z
        .number()
        .int()
        .min(1)
        .max(5)
        .optional()
        .describe("Severity level (integer 1–5)"),
      parentId: z
        .number()
        .int()
        .positive()
        .optional()
        .describe("Parent item ID to nest this harm inside (e.g. a folder)"),
    },
  • Registration of the tool named 'create_harm' via server.registerTool() inside registerRiskWriteTools().
    export function registerRiskWriteTools(
      server: McpServer,
      client: CodebeamerClient,
    ): void {
      server.registerTool(
        "create_harm",
        {
          title: "Create Harm",
          description:
            "Create a new item in a Codebeamer RM Harms List tracker. " +
            "Supports setting the IMDRF code (text) and Severity (integer 1–5). " +
            "Use list_trackers to find the Harms List tracker ID for your project.",
          inputSchema: {
            trackerId: z
              .number()
              .int()
              .positive()
              .describe("Numeric tracker ID of the RM Harms List tracker"),
            name: z.string().min(1).describe("Harm name / summary"),
            description: z
              .string()
              .optional()
              .describe("Harm description (plain text or wiki markup)"),
            imdrfCode: z
              .string()
              .optional()
              .describe("IMDRF code for this harm (e.g. 'E0001')"),
            severity: z
              .number()
              .int()
              .min(1)
              .max(5)
              .optional()
              .describe("Severity level (integer 1–5)"),
            parentId: z
              .number()
              .int()
              .positive()
              .optional()
              .describe("Parent item ID to nest this harm inside (e.g. a folder)"),
          },
        },
        async ({ trackerId, name, description, imdrfCode, severity, parentId }) => {
          const customFields: Array<{ fieldId: number; type: string; value: unknown }> = [];
    
          if (imdrfCode !== undefined) {
            customFields.push({ fieldId: 10000, type: "TextFieldValue", value: imdrfCode });
          }
          if (severity !== undefined) {
            customFields.push({ fieldId: 10001, type: "IntegerFieldValue", value: severity });
          }
    
          const data = {
            name,
            ...(description !== undefined ? { description } : {}),
            ...(customFields.length > 0 ? { customFields } : {}),
          };
    
          const item = await client.createItem(trackerId, data, parentId);
          return { content: [{ type: "text", text: formatItem(item) }] };
        },
      );
    }
  • src/index.ts:38-50 (registration)
    Top-level registration call: registerRiskWriteTools(server, client) wires the tool into the MCP server.
    registerProjectTools(server, client);
    registerTrackerTools(server, client);
    registerItemTools(server, client);
    registerItemDetailTools(server, client);
    registerUserTools(server, client);
    registerItemWriteTools(server, client);
    registerCommentWriteTools(server, client);
    registerAssociationWriteTools(server, client);
    registerRiskWriteTools(server, client);
    
    const transport = new StdioServerTransport();
    await server.connect(transport);
  • The createItem() method on CodebeamerClient that posts to /trackers/{trackerId}/items, used by the 'create_harm' handler.
    createItem(trackerId: number, data: CbCreateItemRequest, parentId?: number): Promise<CbItem> {
      return this.http.post(`/trackers/${trackerId}/items`, {
        params: parentId !== undefined ? { parentItemId: parentId } : undefined,
        body: data,
        resource: `create item in tracker ${trackerId}`,
      });
    }
Behavior2/5

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

No annotations provided, so the description must fully disclose behavior. It describes a write operation but omits side effects, return values, permissions, or workflow triggers. Insufficient for a mutation 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 the main purpose, no fluff. Every sentence serves a purpose.

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?

Covers the core purpose and hints at usage but omits explanation of all parameters (e.g., parentId, description) and does not mention what the response contains. Adequate but not 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 coverage is 100%, so parameters are documented. The description adds minimal value by naming IMDRF code and severity but does not clarify parentId or description beyond the schema.

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 tool creates a new item in a Codebeamer RM Harms List tracker, specifying the resource and action. It differentiates from siblings like create_item by targeting the Harms List tracker type.

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

Usage Guidelines4/5

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

Provides a helpful hint to use list_trackers to find the tracker ID, but does not explicitly state when to use this tool versus alternatives like create_item, nor when not to use it.

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