Skip to main content
Glama

ninja_list_alerts

Retrieve all active alerts from devices. Apply filters by source type or device expression to narrow results.

Instructions

Get all active alerts across all devices. Filter by source type or device filter expression.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceTypeNoAlert source type filter
dfNoDevice filter expression
langNoLanguage tag for localized messages (e.g. en)
tzNoTime zone for timestamps (e.g. America/Chicago)

Implementation Reference

  • The handler for ninja_list_alerts that calls client.get('/alerts', clean(args)) to fetch all active alerts, with optional filtering via sourceType, df, lang, and tz.
      handler: async (args, client: NinjaOneClient) => client.get('/alerts', clean(args)),
    },
  • The inputSchema for ninja_list_alerts defines optional parameters: sourceType, df (device filter), lang (language tag), and tz (time zone).
    inputSchema: {
      type: 'object',
      properties: {
        sourceType: { type: 'string', description: 'Alert source type filter' },
        df: { type: 'string', description: 'Device filter expression' },
        lang: { type: 'string', description: 'Language tag for localized messages (e.g. en)' },
        tz: { type: 'string', description: 'Time zone for timestamps (e.g. America/Chicago)' },
      },
    },
  • ALL_TOOLS bundles all tool definitions from alertTools (and others), which is imported into the main server.
    export const ALL_TOOLS = [
      ...deviceTools,
      ...organizationTools,
      ...alertTools,
      ...activityTools,
      ...ticketingTools,
      ...queryTools,
      ...policyTools,
      ...userTools,
      ...backupTools,
      ...systemTools,
    ];
  • src/index.ts:24-24 (registration)
    The main server creates a toolMap from ALL_TOOLS, keyed by tool name ('ninja_list_alerts') to its handler. The handler is invoked in the CallToolRequestSchema handler.
    const toolMap = new Map(ALL_TOOLS.map((def) => [def.tool.name, def.handler]));
  • The clean() utility function strips null/empty values from the args object before passing them as query parameters to the API call.
    // eslint-disable-next-line @typescript-eslint/no-explicit-any
    export function clean(args: Record<string, any>): Record<string, unknown> {
      return Object.fromEntries(
        Object.entries(args).filter(([, v]) => v != null && v !== ''),
      );
    }
Behavior3/5

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

Description indicates read-only operation on active alerts, but no annotations are provided; fails to disclose details like pagination, rate limits, or result ordering.

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?

Two sentences, zero waste, first sentence states primary purpose immediately.

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

Completeness4/5

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

Adequate for a list tool with optional filters; could mention how filters combine or what fields appear in results but overall sufficient.

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 baseline is 3; description mentions two main filter parameters but adds no extra meaning for 'lang' and 'tz' beyond their schema descriptions.

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?

Clearly states 'Get all active alerts across all devices' with specific verb and resource, and distinguishes from sibling 'ninja_get_device_alerts' which is device-specific.

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

Usage Guidelines4/5

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

Implies cross-device usage via 'across all devices' but does not explicitly reference alternative tools or state when not to use.

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/Allied-Business-Solutions/ninjaone-mcp'

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