Skip to main content
Glama

ninja_query_antivirus_threats

Query antivirus threats detected across managed devices. Filter by device, set maximum results, and paginate with cursor.

Instructions

Query antivirus threats detected across all managed devices.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dfNoDevice filter expression
pageSizeNoMax results to return
cursorNoPagination cursor from previous response

Implementation Reference

  • The handler for 'ninja_query_antivirus_threats' is the generic handler returned by queryTool(), which calls client.get('/queries/antivirus-threats', clean(args)). The handler executes an HTTP GET request to the NinjaOne API endpoint /v2/queries/antivirus-threats with optional pagination/device filter parameters.
      handler: async (args, client: NinjaOneClient) => client.get(path, clean(args)),
    };
  • The input schema for 'ninja_query_antivirus_threats' is defined by queryTool() at line 36-40. It includes base pagination props (df, pageSize, cursor) but no extra properties, so its inputSchema accepts: df (string), pageSize (number), cursor (string).
    return {
      tool: {
        name,
        description,
        inputSchema: {
          type: 'object',
          properties: { ...basePaginationProps, ...extraProps },
        },
  • The tool 'ninja_query_antivirus_threats' is registered in the queryTools array (line 36-40) via the queryTool() helper with name 'ninja_query_antivirus_threats', description 'Query antivirus threats detected across all managed devices.', and path '/queries/antivirus-threats'.
    queryTool(
      'ninja_query_antivirus_threats',
      'Query antivirus threats detected across all managed devices.',
      '/queries/antivirus-threats',
    ),
  • The ALL_TOOLS array in src/tools/index.ts spreads queryTools (along with other tool arrays), which is where the tool registration flows into the server registration in src/index.ts.
    export const ALL_TOOLS = [
      ...deviceTools,
      ...organizationTools,
      ...alertTools,
      ...activityTools,
      ...ticketingTools,
      ...queryTools,
      ...policyTools,
      ...userTools,
      ...backupTools,
      ...systemTools,
    ];
  • src/index.ts:31-60 (registration)
    The MCP server registers all tools via ListToolsRequestSchema (line 31-33) and dispatches calls via CallToolRequestSchema (line 35-60). The tool name to handler mapping is built on line 24 using toolMap = new Map(ALL_TOOLS.map(def => [def.tool.name, def.handler])).
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: ALL_TOOLS.map((def) => def.tool),
    }));
    
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: args } = request.params;
      const handler = toolMap.get(name);
    
      if (!handler) {
        return {
          content: [{ type: 'text', text: `Unknown tool: ${name}` }],
          isError: true,
        };
      }
    
      try {
        const result = await handler(
          (args ?? {}) as Record<string, unknown>,
          ninjaClient,
        );
        return {
          content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
        };
      } catch (err) {
        return {
          content: [{ type: 'text', text: err instanceof Error ? err.message : String(err) }],
          isError: true,
        };
      }
    });
Behavior2/5

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

No annotations are provided, and the description only states 'query' which implies read-only, but it does not disclose any behavioral traits like authentication needs, rate limits, or that it does not modify data. For a tool with no annotations, the description should provide more context.

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?

The description is a single concise sentence that front-loads the purpose. It is appropriately sized for a simple query tool, though it could be slightly expanded to include parameter hints.

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 the tool has pagination parameters and no output schema, the description lacks crucial information about return values, pagination behavior, or expected output format. The agent cannot fully understand what to expect from the response.

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 the parameters are well-documented in the schema. The description adds no additional meaning to the parameters (df, pageSize, cursor), just restates the obvious purpose.

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 the action (query) and the resource (antivirus threats) across all managed devices, distinguishing it from sibling tools like ninja_query_antivirus_status which presumably queries antivirus status rather than threats.

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 is provided on when to use this tool versus alternatives. With many sibling query tools, the agent needs explicit context about when this is appropriate, such as filtering by device or comparing to threat status queries.

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