Skip to main content
Glama

ninja_create_organization

Create a new client organization in NinjaOne with configurable device approval mode, tags, and custom fields.

Instructions

Create a new organization (client) in NinjaOne.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesOrganization name
descriptionNoOrganization description
nodeApprovalModeNoHow new devices are approved
tagsNoOrganization tags
fieldsNoCustom field values

Implementation Reference

  • The handler for 'ninja_create_organization' tool. It accepts args and the NinjaOneClient, and makes a POST request to '/organizations' with the provided arguments (name, description, nodeApprovalMode, tags, fields).
    tool: {
      name: 'ninja_create_organization',
      description: 'Create a new organization (client) in NinjaOne.',
      inputSchema: {
        type: 'object',
        required: ['name'],
        properties: {
          name: { type: 'string', description: 'Organization name' },
          description: { type: 'string', description: 'Organization description' },
          nodeApprovalMode: {
            type: 'string',
            enum: ['AUTOMATIC', 'MANUAL', 'REJECT'],
            description: 'How new devices are approved',
          },
          tags: { type: 'array', items: { type: 'string' }, description: 'Organization tags' },
          fields: {
            type: 'object',
            description: 'Custom field values',
            additionalProperties: true,
          },
        },
      },
    },
    handler: async (args, client: NinjaOneClient) => client.post('/organizations', args),
  • Input schema for 'ninja_create_organization'. Requires 'name' (string), with optional fields: description (string), nodeApprovalMode (enum: AUTOMATIC/MANUAL/REJECT), tags (array of strings), and fields (object for custom field values).
    inputSchema: {
      type: 'object',
      required: ['name'],
      properties: {
        name: { type: 'string', description: 'Organization name' },
        description: { type: 'string', description: 'Organization description' },
        nodeApprovalMode: {
          type: 'string',
          enum: ['AUTOMATIC', 'MANUAL', 'REJECT'],
          description: 'How new devices are approved',
        },
        tags: { type: 'array', items: { type: 'string' }, description: 'Organization tags' },
        fields: {
          type: 'object',
          description: 'Custom field values',
          additionalProperties: true,
        },
      },
    },
  • The tool is exported as part of the 'organizationTools' array which is spread into the ALL_TOOLS array in src/tools/index.ts (line 15). ALL_TOOLS is then used in src/index.ts (line 24) to build a toolMap for the MCP server registration.
    export const organizationTools: ToolDef[] = [
      {
        tool: {
          name: 'ninja_list_organizations',
          description: 'List all organizations (clients/customers) in NinjaOne. Supports filtering and pagination.',
          inputSchema: {
            type: 'object',
            properties: {
              pageSize: { type: 'number', description: 'Max organizations to return' },
              after: { type: 'number', description: 'Last org ID from previous page for pagination' },
              of: { type: 'string', description: 'Organization filter expression' },
            },
          },
        },
        handler: async (args, client: NinjaOneClient) => client.get('/organizations', clean(args)),
      },
      {
        tool: {
          name: 'ninja_get_organizations_detailed',
          description: 'List organizations with detailed settings, policy assignments, and node role mappings.',
          inputSchema: {
            type: 'object',
            properties: {
              pageSize: { type: 'number', description: 'Max organizations to return' },
              after: { type: 'number', description: 'Last org ID for pagination' },
              of: { type: 'string', description: 'Organization filter expression' },
            },
          },
        },
        handler: async (args, client: NinjaOneClient) =>
          client.get('/organizations-detailed', clean(args)),
      },
      {
        tool: {
          name: 'ninja_get_organization',
          description: 'Get detailed information about a specific organization.',
          inputSchema: {
            type: 'object',
            required: ['id'],
            properties: {
              id: { type: 'number', description: 'Organization ID' },
            },
          },
        },
        handler: async ({ id }, client: NinjaOneClient) => client.get(`/organization/${id}`),
      },
      {
        tool: {
          name: 'ninja_create_organization',
          description: 'Create a new organization (client) in NinjaOne.',
          inputSchema: {
            type: 'object',
            required: ['name'],
            properties: {
              name: { type: 'string', description: 'Organization name' },
              description: { type: 'string', description: 'Organization description' },
              nodeApprovalMode: {
                type: 'string',
                enum: ['AUTOMATIC', 'MANUAL', 'REJECT'],
                description: 'How new devices are approved',
              },
              tags: { type: 'array', items: { type: 'string' }, description: 'Organization tags' },
              fields: {
                type: 'object',
                description: 'Custom field values',
                additionalProperties: true,
              },
            },
          },
        },
        handler: async (args, client: NinjaOneClient) => client.post('/organizations', args),
      },
      {
        tool: {
          name: 'ninja_update_organization',
          description: 'Update an existing organization.',
          inputSchema: {
            type: 'object',
            required: ['id'],
            properties: {
              id: { type: 'number', description: 'Organization ID' },
              name: { type: 'string', description: 'Organization name' },
              description: { type: 'string', description: 'Organization description' },
              nodeApprovalMode: {
                type: 'string',
                enum: ['AUTOMATIC', 'MANUAL', 'REJECT'],
                description: 'How new devices are approved',
              },
            },
          },
        },
        handler: async ({ id, ...body }, client: NinjaOneClient) =>
          client.patch(`/organization/${id}`, body),
      },
      {
        tool: {
          name: 'ninja_get_organization_devices',
          description: 'Get all devices belonging to a specific organization.',
          inputSchema: {
            type: 'object',
            required: ['id'],
            properties: {
              id: { type: 'number', description: 'Organization ID' },
              df: { type: 'string', description: 'Device filter expression' },
              pageSize: { type: 'number', description: 'Max devices to return' },
              after: { type: 'number', description: 'Last device ID for pagination' },
            },
          },
        },
        handler: async ({ id, ...params }, client: NinjaOneClient) =>
          client.get(`/organization/${id}/devices`, clean(params)),
      },
      {
        tool: {
          name: 'ninja_get_organization_locations',
          description: 'Get all locations for an organization.',
          inputSchema: {
            type: 'object',
            required: ['id'],
            properties: {
              id: { type: 'number', description: 'Organization ID' },
            },
          },
        },
        handler: async ({ id }, client: NinjaOneClient) =>
          client.get(`/organization/${id}/locations`),
      },
      {
        tool: {
          name: 'ninja_create_organization_location',
          description: 'Create a new location for an organization.',
          inputSchema: {
            type: 'object',
            required: ['id', 'name'],
            properties: {
              id: { type: 'number', description: 'Organization ID' },
              name: { type: 'string', description: 'Location name' },
              description: { type: 'string', description: 'Location description' },
              address: { type: 'string', description: 'Street address' },
              city: { type: 'string', description: 'City' },
              state: { type: 'string', description: 'State or province' },
              country: { type: 'string', description: 'Country code (e.g. US)' },
              zipCode: { type: 'string', description: 'Postal/ZIP code' },
            },
          },
        },
        handler: async ({ id, ...body }, client: NinjaOneClient) =>
          client.post(`/organization/${id}/locations`, body),
      },
      {
        tool: {
          name: 'ninja_get_organization_custom_fields',
          description: 'Get custom field values for an organization.',
          inputSchema: {
            type: 'object',
            required: ['id'],
            properties: {
              id: { type: 'number', description: 'Organization ID' },
              withInheritance: {
                type: 'boolean',
                description: 'Include inherited custom field values',
              },
            },
          },
        },
        handler: async ({ id, ...params }, client: NinjaOneClient) =>
          client.get(`/organization/${id}/custom-fields`, clean(params)),
      },
      {
        tool: {
          name: 'ninja_get_organization_end_users',
          description: 'Get end users associated with an organization.',
          inputSchema: {
            type: 'object',
            required: ['id'],
            properties: {
              id: { type: 'number', description: 'Organization ID' },
            },
          },
        },
        handler: async ({ id }, client: NinjaOneClient) =>
          client.get(`/organization/${id}/end-users`),
      },
    ];
  • src/index.ts:24-24 (registration)
    The MCP server maps tool names to handlers using ALL_TOOLS. The 'ninja_create_organization' handler is stored in toolMap and invoked when the tool is called via CallToolRequestSchema.
    const toolMap = new Map(ALL_TOOLS.map((def) => [def.tool.name, def.handler]));
Behavior2/5

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

No annotations exist, so the description must convey behavioral traits. It only states 'create', which implies a write operation, but does not disclose side effects, required permissions, reversibility, or any impact on existing data. For a creation tool, more context about dependencies (e.g., if organization name must be unique) is needed.

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, concise sentence that directly states the tool's purpose. No extraneous words, front-loaded with the key action and resource. Ideal structure for quick understanding.

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?

Despite having 5 parameters, some with enums and nested objects, the description does not explain return values, error scenarios, idempotency, or required permissions. No output schema exists, so the description should provide more context about what happens upon creation. It is incomplete for safe invocation.

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?

Input schema has 100% description coverage, each parameter clearly described. The description does not add extra meaning beyond the schema, so baseline score of 3 applies. No elaboration on parameter interactions or constraints.

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 'create' and the resource 'organization (client)', specifically in NinjaOne. It effectively distinguishes from sibling tools like 'ninja_create_organization_location' which creates a location, not an organization, and 'ninja_update_organization' which updates an existing one.

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 vs alternatives. There is no mention of prerequisites, when not to use it, or comparison to siblings like 'ninja_create_organization_location' or 'ninja_update_organization'. The agent must infer usage from the name alone.

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