Skip to main content
Glama

create_maintenance_window

Schedule device maintenance to suppress alerts during planned downtime. Disables alerting for specified periods to prevent notifications during maintenance activities.

Instructions

Create a maintenance window for a device to suppress alerts during planned maintenance. The window disables alerting for the specified duration.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
device_idYesNinjaOne device ID to put into maintenance
startYesMaintenance window start time as a Unix timestamp (seconds). Use current time for immediate start.
endYesMaintenance window end time as a Unix timestamp (seconds).
disable_alertsNoWhether to disable alerts during the maintenance window

Implementation Reference

  • Handler function that creates a maintenance window for a device. Accepts device_id, start/end timestamps, and disable_alerts flag. Makes a PUT request to /device/{device_id}/maintenance endpoint with the maintenance window data and returns success message with timestamps or error.
    async ({ device_id, start, end, disable_alerts }) => {
      const data: Record<string, unknown> = {
        start,
        end,
        disabledFeatures: disable_alerts ? ["ALERTS"] : [],
      };
    
      try {
        await client.put(`/device/${device_id}/maintenance`, data);
        return toolResult(
          `Maintenance window created for device ${device_id}.\nStart: ${new Date(start * 1000).toISOString()}\nEnd: ${new Date(end * 1000).toISOString()}`,
        );
      } catch (error) {
        return toolResult(
          `Error creating maintenance window: ${error}`,
          true,
        );
      }
    },
  • Input schema definition using Zod. Defines four parameters: device_id (required number), start (required number - Unix timestamp), end (required number - Unix timestamp), and disable_alerts (optional boolean, defaults to true). Each parameter has descriptive metadata.
      device_id: z.number().describe("NinjaOne device ID to put into maintenance"),
      start: z
        .number()
        .describe(
          "Maintenance window start time as a Unix timestamp (seconds). Use current time for immediate start.",
        ),
      end: z
        .number()
        .describe(
          "Maintenance window end time as a Unix timestamp (seconds).",
        ),
      disable_alerts: z
        .boolean()
        .optional()
        .default(true)
        .describe("Whether to disable alerts during the maintenance window"),
    },
  • Complete tool registration using server.tool(). Registers 'create_maintenance_window' with description, input schema, and handler function. Part of registerMaintenanceTools function that registers multiple maintenance-related tools to the MCP server.
    server.tool(
      "create_maintenance_window",
      "Create a maintenance window for a device to suppress alerts during planned maintenance. The window disables alerting for the specified duration.",
      {
        device_id: z.number().describe("NinjaOne device ID to put into maintenance"),
        start: z
          .number()
          .describe(
            "Maintenance window start time as a Unix timestamp (seconds). Use current time for immediate start.",
          ),
        end: z
          .number()
          .describe(
            "Maintenance window end time as a Unix timestamp (seconds).",
          ),
        disable_alerts: z
          .boolean()
          .optional()
          .default(true)
          .describe("Whether to disable alerts during the maintenance window"),
      },
      async ({ device_id, start, end, disable_alerts }) => {
        const data: Record<string, unknown> = {
          start,
          end,
          disabledFeatures: disable_alerts ? ["ALERTS"] : [],
        };
    
        try {
          await client.put(`/device/${device_id}/maintenance`, data);
          return toolResult(
            `Maintenance window created for device ${device_id}.\nStart: ${new Date(start * 1000).toISOString()}\nEnd: ${new Date(end * 1000).toISOString()}`,
          );
        } catch (error) {
          return toolResult(
            `Error creating maintenance window: ${error}`,
            true,
          );
        }
      },
    );
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions that the window 'disables alerting' and includes a parameter for 'disable_alerts', but fails to disclose critical behavioral traits such as required permissions, whether the action is reversible, rate limits, or error conditions. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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?

The description is front-loaded and efficiently structured in two sentences: the first states the purpose and action, and the second explains the behavioral effect. Every sentence earns its place by adding value, with no redundant or verbose language, making it highly concise and well-organized.

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?

Given the tool's complexity as a mutation operation with no annotations and no output schema, the description is incomplete. It covers the basic purpose and effect but lacks details on permissions, error handling, return values, or integration with sibling tools. While concise, it does not provide enough context for safe and effective use by an AI agent without additional assumptions.

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 coverage is 100%, providing detailed descriptions for all parameters. The description adds minimal value beyond the schema, only implicitly referencing 'duration' and 'alerts' without explaining parameter interactions or additional semantics. With high schema coverage, the baseline score of 3 is appropriate, as the description does not compensate but also does not detract.

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 specific action ('Create a maintenance window') and its purpose ('to suppress alerts during planned maintenance'), distinguishing it from siblings like cancel_device_maintenance or list_maintenance_windows. It explicitly mentions the resource ('device') and the functional outcome ('disables alerting for the specified duration'), making the purpose unambiguous.

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?

The description implies usage context ('during planned maintenance') but does not explicitly state when to use this tool versus alternatives like cancel_device_maintenance or list_maintenance_windows. It provides a general scenario but lacks specific guidance on prerequisites, exclusions, or comparisons with sibling tools, leaving some ambiguity for the agent.

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/fredriksknese/mcp-ninjaone'

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