list_widget_templates
Retrieve widget templates for security dashboards with filtering by visualization type and category to customize security insights displays.
Instructions
List widget templates with optional filtering by visualization type and category
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of results to return (default: 10, min: 1) | |
| offset | No | Pagination offset (default: 0, min: 0) | |
| visualization_type | No | Filter by visualization type | |
| category | No | Filter by category |
Implementation Reference
- src/operations/dashboards.ts:43-63 (handler)The core handler function that executes the tool logic by constructing parameters and making an API request to list widget templates.export async function listWidgetTemplates( client: RadSecurityClient, limit: number = 50, offset: number = 0, visualization_type?: string, category?: string ): Promise<any> { const params: Record<string, any> = { limit, offset }; if (visualization_type) { params.visualization_type = visualization_type; } if (category) { params.category = category; } return client.makeRequest( `/accounts/${client.getAccountId()}/dashboards/widget_templates`, params ); }
- src/operations/dashboards.ts:4-10 (schema)Zod schema defining the input parameters for the list_widget_templates tool, used for validation.// Schema for list_widget_templates export const ListWidgetTemplatesSchema = z.object({ limit: z.number().optional().default(10).describe("Maximum number of results to return (default: 10, min: 1)"), offset: z.number().optional().default(0).describe("Pagination offset (default: 0, min: 0)"), visualization_type: z.string().optional().describe("Filter by visualization type"), category: z.string().optional().describe("Filter by category"), });
- src/index.ts:655-661 (registration)Tool registration in the ListTools MCP request handler, advertising the tool's name, description, and input schema.name: "list_widget_templates", description: "List widget templates with optional filtering by visualization type and category", inputSchema: zodToJsonSchema( dashboards.ListWidgetTemplatesSchema ), },
- src/index.ts:1597-1613 (registration)Tool call handler in the CallToolRequest MCP handler, which parses arguments and dispatches to the listWidgetTemplates function.case "list_widget_templates": { const args = dashboards.ListWidgetTemplatesSchema.parse( request.params.arguments ); const response = await dashboards.listWidgetTemplates( client, args.limit, args.offset, args.visualization_type, args.category ); return { content: [ { type: "text", text: JSON.stringify(response, null, 2) }, ], }; }