Skip to main content
Glama

misp_add_attributes_bulk

Add multiple Indicators of Compromise (IOCs) to a MISP event in a single request, streamlining bulk attribute input.

Instructions

Add multiple attributes (IOCs) to a MISP event at once

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
eventIdYesEvent ID to add attributes to
attributesYesArray of attributes to add

Implementation Reference

  • The handler function for misp_add_attributes_bulk that iterates over the attributes array, calls client.addAttribute() for each, collects results (success/failure), and returns a JSON summary.
    async ({ eventId, attributes }) => {
      try {
        const results: Array<{ value: string; type: string; id?: string; error?: string }> = [];
    
        for (const attr of attributes) {
          try {
            const created = await client.addAttribute(eventId, {
              type: attr.type,
              value: attr.value,
              category: attr.category,
              to_ids: attr.toIds,
              comment: attr.comment,
            });
            results.push({
              value: attr.value,
              type: attr.type,
              id: created.id,
            });
          } catch (err) {
            results.push({
              value: attr.value,
              type: attr.type,
              error: err instanceof Error ? err.message : String(err),
            });
          }
        }
    
        const succeeded = results.filter((r) => r.id);
        const failed = results.filter((r) => r.error);
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(
                {
                  total: attributes.length,
                  succeeded: succeeded.length,
                  failed: failed.length,
                  results,
                },
                null,
                2
              ),
            },
          ],
        };
      } catch (err) {
        return {
          content: [
            { type: "text", text: `Error adding attributes: ${err instanceof Error ? err.message : String(err)}` },
          ],
          isError: true,
        };
      }
    }
  • The tool registration and schema definition for misp_add_attributes_bulk, including the input schema (eventId: string, attributes: array of objects with type, value, category, toIds, comment) using Zod validation.
    // Bulk add attributes
    server.tool(
      "misp_add_attributes_bulk",
      "Add multiple attributes (IOCs) to a MISP event at once",
      {
        eventId: z.string().describe("Event ID to add attributes to"),
        attributes: z.array(
          z.object({
            type: z.string().describe("Attribute type"),
            value: z.string().describe("IOC value"),
            category: z.string().optional().describe("Category"),
            toIds: z.boolean().optional().describe("IDS flag"),
            comment: z.string().optional().describe("Comment"),
          })
        ).describe("Array of attributes to add"),
      },
  • The full registration block via server.tool() that binds the tool name 'misp_add_attributes_bulk' to its schema and handler within the registerAttributeTools function.
    // Bulk add attributes
    server.tool(
      "misp_add_attributes_bulk",
      "Add multiple attributes (IOCs) to a MISP event at once",
      {
        eventId: z.string().describe("Event ID to add attributes to"),
        attributes: z.array(
          z.object({
            type: z.string().describe("Attribute type"),
            value: z.string().describe("IOC value"),
            category: z.string().optional().describe("Category"),
            toIds: z.boolean().optional().describe("IDS flag"),
            comment: z.string().optional().describe("Comment"),
          })
        ).describe("Array of attributes to add"),
      },
      async ({ eventId, attributes }) => {
        try {
          const results: Array<{ value: string; type: string; id?: string; error?: string }> = [];
    
          for (const attr of attributes) {
            try {
              const created = await client.addAttribute(eventId, {
                type: attr.type,
                value: attr.value,
                category: attr.category,
                to_ids: attr.toIds,
                comment: attr.comment,
              });
              results.push({
                value: attr.value,
                type: attr.type,
                id: created.id,
              });
            } catch (err) {
              results.push({
                value: attr.value,
                type: attr.type,
                error: err instanceof Error ? err.message : String(err),
              });
            }
          }
    
          const succeeded = results.filter((r) => r.id);
          const failed = results.filter((r) => r.error);
    
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(
                  {
                    total: attributes.length,
                    succeeded: succeeded.length,
                    failed: failed.length,
                    results,
                  },
                  null,
                  2
                ),
              },
            ],
          };
        } catch (err) {
          return {
            content: [
              { type: "text", text: `Error adding attributes: ${err instanceof Error ? err.message : String(err)}` },
            ],
            isError: true,
          };
        }
      }
    );
  • src/index.ts:6-32 (registration)
    Import and invocation of registerAttributeTools() (which registers misp_add_attributes_bulk) in the main server entry point.
    import { registerAttributeTools } from "./tools/attributes.js";
    import { registerCorrelationTools } from "./tools/correlation.js";
    import { registerTagTools } from "./tools/tags.js";
    import { registerExportTools } from "./tools/exports.js";
    import { registerSightingTools } from "./tools/sightings.js";
    import { registerWarninglistTools } from "./tools/warninglists.js";
    import { registerObjectTools } from "./tools/objects.js";
    import { registerGalaxyTools } from "./tools/galaxies.js";
    import { registerFeedTools } from "./tools/feeds.js";
    import { registerOrganisationTools } from "./tools/organisations.js";
    import { registerServerTools } from "./tools/servers.js";
    import { registerResources } from "./resources.js";
    import { registerPrompts } from "./prompts.js";
    
    const config = getConfig();
    const client = new MispClient(config);
    
    const server = new McpServer({
      name: "misp-mcp",
      version: "1.2.0",
      description:
        "MCP server for MISP threat intelligence platform - IOC lookups, event management, correlation discovery, and intelligence enrichment",
    });
    
    // Register all tools
    registerEventTools(server, client);
    registerAttributeTools(server, client);
Behavior2/5

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

No annotations are provided, so the description must fully convey behavioral traits. It only states 'Add', implying a mutation, but omits details such as side effects, permissions, rate limits, or return behavior (e.g., success indication). This is insufficient for safe agent usage.

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?

The description is a single, focused sentence with no superfluous content. It is front-loaded with the core action and resource, making it easy to parse.

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

Completeness2/5

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

For a bulk operation tool with a structured input (array of objects), no output schema, and no annotations, the description is too sparse. It does not explain return values, error conditions, or array validation rules, leaving critical gaps for an AI agent.

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 schema provides descriptions for all parameters (100% coverage). The description adds no additional meaning beyond the schema, only loosely equating attributes to 'IOCs'. A score of 3 is appropriate as the baseline when schema coverage is complete.

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 specifies the verb 'Add', the resource 'multiple attributes (IOCs)', and the target 'to a MISP event at once'. It effectively distinguishes itself from the sibling tool misp_add_attribute by emphasizing bulk operation.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like misp_add_attribute, nor does it state prerequisites or exclusions. The phrase 'at once' implies bulk usage but lacks explicit comparison or context.

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/solomonneas/misp-mcp'

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