Skip to main content
Glama

cancel_device_maintenance

Cancel active maintenance windows to immediately re-enable alerting for monitored devices in NinjaOne.

Instructions

Cancel an active maintenance window for a device, immediately re-enabling alerting.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
device_idYesNinjaOne device ID to remove from maintenance

Implementation Reference

  • Handler function for cancel_device_maintenance tool. Makes a DELETE request to /device/{device_id}/maintenance endpoint to cancel the maintenance window and re-enable alerting.
    async ({ device_id }) => {
      try {
        await client.delete(`/device/${device_id}/maintenance`);
        return toolResult(
          `Maintenance window cancelled for device ${device_id}. Alerting is now re-enabled.`,
        );
      } catch (error) {
        return toolResult(
          `Error cancelling maintenance window: ${error}`,
          true,
        );
      }
    },
  • Zod schema definition for the cancel_device_maintenance tool input. Defines device_id as a required number parameter describing the NinjaOne device ID.
    {
      device_id: z
        .number()
        .describe("NinjaOne device ID to remove from maintenance"),
  • Registration of cancel_device_maintenance tool with MCP server. Includes tool name, description, input schema, and handler function.
    server.tool(
      "cancel_device_maintenance",
      "Cancel an active maintenance window for a device, immediately re-enabling alerting.",
      {
        device_id: z
          .number()
          .describe("NinjaOne device ID to remove from maintenance"),
      },
      async ({ device_id }) => {
        try {
          await client.delete(`/device/${device_id}/maintenance`);
          return toolResult(
            `Maintenance window cancelled for device ${device_id}. Alerting is now re-enabled.`,
          );
        } catch (error) {
          return toolResult(
            `Error cancelling maintenance window: ${error}`,
            true,
          );
        }
      },
    );
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses the key behavioral trait of 'immediately re-enabling alerting,' which is crucial for understanding the tool's effect. However, it lacks details on permissions, error conditions, or confirmation of cancellation, leaving gaps in behavioral context.

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 a single, efficient sentence that front-loads the core action and consequence. Every word earns its place, with no wasted text, making it highly concise and well-structured for quick understanding.

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 moderate complexity (a mutation operation with no annotations or output schema), the description is adequate but incomplete. It covers the purpose and immediate effect but lacks information on prerequisites, error handling, or what happens if maintenance isn't active, which could hinder agent effectiveness.

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?

The input schema has 100% description coverage, with the parameter 'device_id' well-documented in the schema. The description does not add any additional meaning or context beyond what the schema provides, such as examples or constraints, so it meets the baseline for high schema coverage without enhancement.

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 ('cancel') and resource ('active maintenance window for a device'), and distinguishes it from siblings by focusing on maintenance cancellation rather than creation, retrieval, or other device operations. It precisely defines the tool's function without restating the name.

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?

The description implies usage context by specifying 'active maintenance window,' suggesting it should be used when maintenance is currently active. However, it does not explicitly state when not to use it (e.g., if no maintenance exists) or name alternatives like 'create_maintenance_window' for comparison, leaving some guidance implicit.

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