misp_list_object_templates
Browse MISP object templates (file, domain-ip, email, etc.) with optional name filter and result limit.
Instructions
List available MISP object templates (file, domain-ip, email, network-connection, etc.)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| search | No | Filter templates by name | |
| limit | No | Max results (default 50) |
Implementation Reference
- src/tools/objects.ts:7-60 (handler)Handler function for the 'misp_list_object_templates' tool. Takes optional 'search' and 'limit' parameters, calls client.listObjectTemplates(), filters/slices results, and returns formatted JSON.
server.tool( "misp_list_object_templates", "List available MISP object templates (file, domain-ip, email, network-connection, etc.)", { search: z.string().optional().describe("Filter templates by name"), limit: z.number().optional().describe("Max results (default 50)"), }, async ({ search, limit }) => { try { const templates = await client.listObjectTemplates(); let filtered = templates; if (search) { const q = search.toLowerCase(); filtered = templates.filter( (t) => t.name.toLowerCase().includes(q) || t.description.toLowerCase().includes(q) ); } if (limit && limit > 0) { filtered = filtered.slice(0, limit); } if (filtered.length === 0) { return { content: [{ type: "text", text: "No object templates found." }], }; } const summary = filtered.map((t) => ({ id: t.id, uuid: t.uuid, name: t.name, description: t.description, version: t.version, meta_category: t.meta_category, })); return { content: [{ type: "text", text: JSON.stringify(summary, null, 2) }], }; } catch (err) { return { content: [ { type: "text", text: `Error listing object templates: ${err instanceof Error ? err.message : String(err)}`, }, ], isError: true, }; } } ); - src/tools/objects.ts:10-13 (schema)Zod schema for the tool's input parameters: optional 'search' string and optional 'limit' number.
{ search: z.string().optional().describe("Filter templates by name"), limit: z.number().optional().describe("Max results (default 50)"), }, - src/index.ts:12-12 (registration)Import of registerObjectTools in the main server entry point.
import { registerObjectTools } from "./tools/objects.js"; - src/index.ts:38-38 (registration)Registration call that wires the tools into the MCP server.
registerObjectTools(server, client); - src/client.ts:472-477 (helper)Client helper method that makes the HTTP GET request to /objectTemplates endpoint and maps the response.
async listObjectTemplates(): Promise<MispObjectTemplate[]> { const data = await this.request< Array<{ ObjectTemplate: MispObjectTemplate }> >("GET", "/objectTemplates"); return (data || []).map((t) => t.ObjectTemplate); }