Skip to main content
Glama

misp_search_events

Search MISP events by IOC value, attribute type, tags, date range, or organization to find relevant threat intelligence.

Instructions

Search MISP events by IOC value, type, tags, date range, or organization

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
valueNoIOC value to search across all attributes
typeNoAttribute type filter (ip-src, ip-dst, domain, md5, sha256, url, email-src, etc.)
categoryNoCategory filter (Network activity, Payload delivery, External analysis, etc.)
tagsNoTag filters (e.g., tlp:white, misp-galaxy:mitre-attack-pattern)
eventIdNoSpecific event ID
orgNoOrganization filter
dateFromNoStart date (YYYY-MM-DD)
dateToNoEnd date (YYYY-MM-DD)
lastNoRelative time (e.g., 1d, 7d, 30d, 6m)
publishedNoOnly published events
limitNoMax results (default 50)
pageNoPage number for pagination

Implementation Reference

  • The handler function for the misp_search_events tool. It receives validated params, calls client.searchEvents(), maps results to a summary (id, info, date, threat_level, analysis, published, org, attribute_count, tags), and returns them as JSON text.
    async (params) => {
      try {
        const events = await client.searchEvents({
          value: params.value,
          type: params.type,
          category: params.category,
          tags: params.tags,
          eventid: params.eventId,
          org: params.org,
          dateFrom: params.dateFrom,
          dateTo: params.dateTo,
          last: params.last,
          published: params.published,
          limit: params.limit,
          page: params.page,
        });
    
        if (events.length === 0) {
          return {
            content: [{ type: "text", text: "No events found matching the search criteria." }],
          };
        }
    
        const summary = events.map((e) => ({
          id: e.id,
          info: e.info,
          date: e.date,
          threat_level: ["", "High", "Medium", "Low", "Undefined"][
            parseInt(e.threat_level_id) || 0
          ],
          analysis: ["Initial", "Ongoing", "Complete"][parseInt(e.analysis) || 0],
          published: e.published,
          org: e.Orgc?.name || "Unknown",
          attribute_count: e.attribute_count,
          tags: (e.Tag || []).map((t) => t.name),
        }));
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(summary, null, 2),
            },
          ],
        };
      } catch (err) {
        return {
          content: [
            { type: "text", text: `Error searching events: ${err instanceof Error ? err.message : String(err)}` },
          ],
          isError: true,
        };
      }
    }
  • Zod schema definitions for all input parameters of misp_search_events: value, type, category, tags, eventId, org, dateFrom, dateTo, last, published, limit, page.
    {
      value: z.string().optional().describe("IOC value to search across all attributes"),
      type: z.string().optional().describe("Attribute type filter (ip-src, ip-dst, domain, md5, sha256, url, email-src, etc.)"),
      category: z.string().optional().describe("Category filter (Network activity, Payload delivery, External analysis, etc.)"),
      tags: z.array(z.string()).optional().describe("Tag filters (e.g., tlp:white, misp-galaxy:mitre-attack-pattern)"),
      eventId: z.string().optional().describe("Specific event ID"),
      org: z.string().optional().describe("Organization filter"),
      dateFrom: z.string().optional().describe("Start date (YYYY-MM-DD)"),
      dateTo: z.string().optional().describe("End date (YYYY-MM-DD)"),
      last: z.string().optional().describe("Relative time (e.g., 1d, 7d, 30d, 6m)"),
      published: z.boolean().optional().describe("Only published events"),
      limit: z.number().optional().describe("Max results (default 50)"),
      page: z.number().optional().describe("Page number for pagination"),
    },
  • Registration of the tool via server.tool('misp_search_events', ...) within the registerEventTools function.
    server.tool(
      "misp_search_events",
      "Search MISP events by IOC value, type, tags, date range, or organization",
      {
        value: z.string().optional().describe("IOC value to search across all attributes"),
        type: z.string().optional().describe("Attribute type filter (ip-src, ip-dst, domain, md5, sha256, url, email-src, etc.)"),
        category: z.string().optional().describe("Category filter (Network activity, Payload delivery, External analysis, etc.)"),
        tags: z.array(z.string()).optional().describe("Tag filters (e.g., tlp:white, misp-galaxy:mitre-attack-pattern)"),
        eventId: z.string().optional().describe("Specific event ID"),
        org: z.string().optional().describe("Organization filter"),
        dateFrom: z.string().optional().describe("Start date (YYYY-MM-DD)"),
        dateTo: z.string().optional().describe("End date (YYYY-MM-DD)"),
        last: z.string().optional().describe("Relative time (e.g., 1d, 7d, 30d, 6m)"),
        published: z.boolean().optional().describe("Only published events"),
        limit: z.number().optional().describe("Max results (default 50)"),
        page: z.number().optional().describe("Page number for pagination"),
      },
      async (params) => {
        try {
          const events = await client.searchEvents({
            value: params.value,
            type: params.type,
            category: params.category,
            tags: params.tags,
            eventid: params.eventId,
            org: params.org,
            dateFrom: params.dateFrom,
            dateTo: params.dateTo,
            last: params.last,
            published: params.published,
            limit: params.limit,
            page: params.page,
          });
    
          if (events.length === 0) {
            return {
              content: [{ type: "text", text: "No events found matching the search criteria." }],
            };
          }
    
          const summary = events.map((e) => ({
            id: e.id,
            info: e.info,
            date: e.date,
            threat_level: ["", "High", "Medium", "Low", "Undefined"][
              parseInt(e.threat_level_id) || 0
            ],
            analysis: ["Initial", "Ongoing", "Complete"][parseInt(e.analysis) || 0],
            published: e.published,
            org: e.Orgc?.name || "Unknown",
            attribute_count: e.attribute_count,
            tags: (e.Tag || []).map((t) => t.name),
          }));
    
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(summary, null, 2),
              },
            ],
          };
        } catch (err) {
          return {
            content: [
              { type: "text", text: `Error searching events: ${err instanceof Error ? err.message : String(err)}` },
            ],
            isError: true,
          };
        }
      }
    );
  • The client.searchEvents() helper method that builds the request body and sends a POST to /events/restSearch on the MISP API. Returns mapped MispEvent[] from the response.
    async searchEvents(params: {
      value?: string;
      type?: string;
      category?: string;
      tags?: string[];
      eventid?: string;
      org?: string;
      dateFrom?: string;
      dateTo?: string;
      last?: string;
      published?: boolean;
      limit?: number;
      page?: number;
    }): Promise<MispEvent[]> {
      const body: Record<string, unknown> = {
        returnFormat: "json",
        limit: params.limit ?? 50,
      };
    
      if (params.value) body.value = params.value;
      if (params.type) body.type = params.type;
      if (params.category) body.category = params.category;
      if (params.tags) body.tags = params.tags;
      if (params.eventid) body.eventid = params.eventid;
      if (params.org) body.org = params.org;
      if (params.dateFrom) body.from = params.dateFrom;
      if (params.dateTo) body.to = params.dateTo;
      if (params.last) body.last = params.last;
      if (params.published !== undefined) body.published = params.published ? 1 : 0;
      if (params.page) body.page = params.page;
    
      const data = await this.request<EventSearchResponse>(
        "POST",
        "/events/restSearch",
        body
      );
      return (data.response || []).map((r) => r.Event);
    }
  • Type definition for EventSearchResponse used by the helper to type the API response.
    export interface EventSearchResponse {
      response: Array<{ Event: MispEvent }>;
    }
Behavior2/5

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

With no annotations, the description provides minimal behavioral insight. It implies read-only search but doesn't confirm idempotency, rate limits, result ordering, or how filters combine (AND vs OR). No mention of output structure or pagination details beyond parameter names.

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?

Single sentence with key information front-loaded. Efficient but very brief; could benefit from added context without harming conciseness. Appropriate for a simple search tool.

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?

Missing critical context for a tool with 12 parameters and no output schema: no explanation of return format (event list vs. count), pagination behavior, default behavior when no filters applied, or how multiple criteria combine (e.g., AND vs OR). The complexity warrants a more complete description.

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 well-documented in the schema. The description adds only a general enumeration of filter types, which is a high-level summary already present in parameter descriptions. No additional semantics 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?

Description clearly states it searches MISP events and lists key filter dimensions (IOC value, type, tags, date range, organization). This distinguishes it from sibling tools like misp_search_attributes (which searches attributes across events) and misp_get_event (which retrieves a single event).

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?

No guidance on when to use this tool versus siblings such as misp_search_by_tag or misp_search_attributes. The description does not mention trade-offs, prerequisites, or exclusion criteria.

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