Skip to main content
Glama

misp_search_attributes

Search for indicators of compromise across all MISP events using filters on attribute value, type, category, and tags.

Instructions

Search for specific attributes (IOCs) across all MISP events

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
valueNoIOC value to search
typeNoAttribute type (ip-src, ip-dst, domain, md5, sha256, url, email-src, hostname, etc.)
categoryNoCategory filter
tagsNoTag filters
toIdsNoOnly IDS-flagged attributes
includeCorrelationsNoInclude correlation data
lastNoRelative time filter (e.g., 1d, 7d, 30d)
limitNoMax results (default 50)

Implementation Reference

  • The registerAttributeTools function registers the 'misp_search_attributes' tool on the MCP server. The handler (lines 20-69) receives search parameters, calls client.searchAttributes(), and returns a formatted JSON summary of matching attributes including event info, tags, and correlations.
    export function registerAttributeTools(server: McpServer, client: MispClient): void {
      // Search attributes
      server.tool(
        "misp_search_attributes",
        "Search for specific attributes (IOCs) across all MISP events",
        {
          value: z.string().optional().describe("IOC value to search"),
          type: z.string().optional().describe("Attribute type (ip-src, ip-dst, domain, md5, sha256, url, email-src, hostname, etc.)"),
          category: z.string().optional().describe("Category filter"),
          tags: z.array(z.string()).optional().describe("Tag filters"),
          toIds: z.boolean().optional().describe("Only IDS-flagged attributes"),
          includeCorrelations: z.boolean().optional().describe("Include correlation data"),
          last: z.string().optional().describe("Relative time filter (e.g., 1d, 7d, 30d)"),
          limit: z.number().optional().describe("Max results (default 50)"),
        },
        async (params) => {
          try {
            const attributes = await client.searchAttributes({
              value: params.value,
              type: params.type,
              category: params.category,
              tags: params.tags,
              to_ids: params.toIds,
              includeCorrelations: params.includeCorrelations,
              last: params.last,
              limit: params.limit,
            });
    
            if (attributes.length === 0) {
              return {
                content: [{ type: "text", text: "No attributes found matching the search criteria." }],
              };
            }
    
            const summary = attributes.map((a) => ({
              id: a.id,
              event_id: a.event_id,
              type: a.type,
              category: a.category,
              value: a.value,
              to_ids: a.to_ids,
              comment: a.comment || undefined,
              tags: (a.Tag || []).map((t) => t.name),
              event_info: a.Event?.info,
              correlations: a.RelatedAttribute
                ? a.RelatedAttribute.map((r) => ({
                    value: r.value,
                    type: r.type,
                    event_id: r.event_id,
                  }))
                : undefined,
            }));
    
            return {
              content: [{ type: "text", text: JSON.stringify(summary, null, 2) }],
            };
          } catch (err) {
            return {
              content: [
                { type: "text", text: `Error searching attributes: ${err instanceof Error ? err.message : String(err)}` },
              ],
              isError: true,
            };
          }
        }
      );
  • Input schema/validation for misp_search_attributes using Zod. Defines optional parameters: value, type, category, tags (string array), toIds, includeCorrelations, last, and limit.
    {
      value: z.string().optional().describe("IOC value to search"),
      type: z.string().optional().describe("Attribute type (ip-src, ip-dst, domain, md5, sha256, url, email-src, hostname, etc.)"),
      category: z.string().optional().describe("Category filter"),
      tags: z.array(z.string()).optional().describe("Tag filters"),
      toIds: z.boolean().optional().describe("Only IDS-flagged attributes"),
      includeCorrelations: z.boolean().optional().describe("Include correlation data"),
      last: z.string().optional().describe("Relative time filter (e.g., 1d, 7d, 30d)"),
      limit: z.number().optional().describe("Max results (default 50)"),
    },
  • The searchAttributes method on MispClient executes the actual API call to /attributes/restSearch, building the request body from params and returning parsed MispAttribute[] from the response.
    async searchAttributes(params: {
      value?: string;
      type?: string;
      category?: string;
      tags?: string[];
      to_ids?: boolean;
      includeCorrelations?: boolean;
      last?: string;
      limit?: number;
    }): Promise<MispAttribute[]> {
      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.to_ids !== undefined) body.to_ids = params.to_ids ? 1 : 0;
      if (params.includeCorrelations)
        body.includeCorrelations = 1;
      if (params.last) body.last = params.last;
    
      const data = await this.request<AttributeSearchResponse>(
        "POST",
        "/attributes/restSearch",
        body
      );
      return data.response?.Attribute || [];
    }
  • src/index.ts:31-32 (registration)
    The tool registration is invoked in the main index.ts file via registerAttributeTools(server, client) on line 32.
    registerEventTools(server, client);
    registerAttributeTools(server, client);
  • The AttributeSearchResponse type used by the helper/searchAttributes client method to parse the API response.
    export interface AttributeSearchResponse {
      response: {
        Attribute: MispAttribute[];
      };
    }
Behavior2/5

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

No annotations are provided, so the description must carry the full burden. It only states 'Search' but does not disclose behavioral traits such as whether it is read-only, network activity, rate limits, or required permissions. This is insufficient for a mutation-less search 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?

The description is a single sentence of 11 words, front-loaded with the key action and scope. No extraneous information; every word contributes to the purpose.

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?

Given 8 parameters, no output schema, and no annotations, the description is too brief. It does not explain the output format, pagination, default behavior, or any constraints beyond the basic search. This is incomplete for effective use without additional documentation.

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 description coverage is 100%, so the baseline is 3. The description adds no additional parameter semantics beyond what is already in the schema. Each parameter is well-described in the schema, so the tool description does not need to elaborate.

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 'Search for specific attributes (IOCs) across all MISP events', specifying the verb (Search), resource (attributes/IOCs), and scope (all MISP events). This distinguishes it from sibling tools like misp_search_events and misp_search_by_tag.

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 for searching specific attributes but provides no explicit when-to-use or when-not-to-use guidance. With many sibling tools, explicit alternatives or context would improve clarity.

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