Skip to main content
Glama

ninja_submit_os_patch_apply

Apply OS patches on a device, either specific patches or all approved pending patches.

Instructions

Apply OS patches on a device. Omit patchIds to apply all approved pending patches.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesDevice ID
patchIdsNoSpecific patch IDs to apply (omit to apply all approved pending patches)

Implementation Reference

  • The tool definition for 'ninja_submit_os_patch_apply'. Defines the schema (name, description, inputSchema with 'id' required and optional 'patchIds' array) and the handler that POSTs to /device/{id}/patch/os/apply with optional patchIds body.
    {
      tool: {
        name: 'ninja_submit_os_patch_apply',
        description: 'Apply OS patches on a device. Omit patchIds to apply all approved pending patches.',
        inputSchema: {
          type: 'object',
          required: ['id'],
          properties: {
            id: { type: 'number', description: 'Device ID' },
            patchIds: {
              type: 'array',
              items: { type: 'number' },
              description: 'Specific patch IDs to apply (omit to apply all approved pending patches)',
            },
          },
        },
      },
      handler: async ({ id, patchIds }, client: NinjaOneClient) =>
        client.post(`/device/${id}/patch/os/apply`, patchIds ? { patchIds } : undefined),
    },
  • The deviceTools array is exported from this file and imported into tools/index.ts (line 4), which is then collected into ALL_TOOLS and used to register the tool with the MCP server in src/index.ts (line 24).
    export const deviceTools: ToolDef[] = [
  • src/tools/index.ts:4-4 (registration)
    Imports deviceTools from devices.ts, which includes the ninja_submit_os_patch_apply tool.
    import { deviceTools } from './devices.js';
  • src/index.ts:24-24 (registration)
    Builds a tool map from ALL_TOOLS, using the tool name as key and handler as value, enabling lookup on CallToolRequestSchema.
    const toolMap = new Map(ALL_TOOLS.map((def) => [def.tool.name, def.handler]));
  • Defines the ToolDef interface used to type the tool definition objects, including the Tool schema and handler function signature.
    import { Tool } from '@modelcontextprotocol/sdk/types.js';
    import { NinjaOneClient } from '../client.js';
    
    export interface ToolDef {
      tool: Tool;
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      handler: (args: any, client: NinjaOneClient) => Promise<unknown>;
    }
Behavior2/5

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

No annotations provided, and description does not disclose important behavioral traits such as potential reboot, system downtime, or permission requirements. Only states basic apply action.

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?

Single sentence with two clauses, no redundancy. Front-loads the main action, omits unnecessary words.

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

Completeness3/5

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

Covers the core action and optional parameter usage, but lacks information about return values (e.g., job ID) or post-apply steps. Adequate for a simple tool but not complete.

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 description covers 100% of parameters, and description restates the optional parameter behavior. Adds marginal value over schema; baseline 3.

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 verb 'Apply' and resource 'OS patches on a device'. It distinguishes from sibling tools like ninja_submit_os_patch_scan (scan) and ninja_submit_software_patch_apply (software patches).

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?

Provides guidance on omitting patchIds to apply all approved pending patches, but lacks explicit direction on when to prefer this tool over alternatives or prerequisites like checking pending patches.

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