Skip to main content
Glama

ninja_list_organizations

Retrieve a list of organizations (clients/customers) from NinjaOne with support for filtering by criteria and paginating results.

Instructions

List all organizations (clients/customers) in NinjaOne. Supports filtering and pagination.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageSizeNoMax organizations to return
afterNoLast org ID from previous page for pagination
ofNoOrganization filter expression

Implementation Reference

  • Definition of 'ninja_list_organizations' tool including its input schema and handler. The handler function calls client.get('/organizations', clean(args)) to list all organizations with optional filtering and pagination.
    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)),
      },
  • Input schema for 'ninja_list_organizations': optional pageSize (number), after (number for pagination), and of (string for organization filter expression).
    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)),
      },
  • All tools including organizationTools are aggregated in ALL_TOOLS array and exposed via the MCP server.
    export const ALL_TOOLS = [
      ...deviceTools,
      ...organizationTools,
      ...alertTools,
      ...activityTools,
      ...ticketingTools,
      ...queryTools,
      ...policyTools,
      ...userTools,
      ...backupTools,
      ...systemTools,
    ];
  • src/index.ts:24-33 (registration)
    toolMap is built from ALL_TOOLS mapping tool name to handler, and tools are listed via ListToolsRequestSchema handler.
    const toolMap = new Map(ALL_TOOLS.map((def) => [def.tool.name, def.handler]));
    
    const server = new Server(
      { name: 'ninjaone-mcp', version: '1.0.0' },
      { capabilities: { tools: {} } },
    );
    
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: ALL_TOOLS.map((def) => def.tool),
    }));
  • The clean() utility strips null/empty values from args before passing them as query parameters to the API call.
    export function clean(args: Record<string, any>): Record<string, unknown> {
      return Object.fromEntries(
        Object.entries(args).filter(([, v]) => v != null && v !== ''),
      );
    }
Behavior3/5

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

Without annotations, the description partially discloses behavior: it indicates a read-only list operation and mentions filtering and pagination. However, it does not detail any side effects, data freshness, rate limits, or other behavioral traits that could affect tool selection.

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 exceptionally concise: two short clauses in one sentence. It front-loads the core purpose and wastes no words, making it efficient for an agent to parse.

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?

The description covers the basic purpose and parameters but does not explain return values, pagination token handling, or the structure of the response. Given the low complexity (list with pagination), it is adequate but not fully 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?

The input schema has 100% description coverage for its 3 parameters, so the description's mention of 'filtering and pagination' adds minimal semantic value beyond the schema. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'List' and resource 'organizations', and adds context that organizations are clients/customers. However, it does not explicitly differentiate from sibling tools like ninja_get_organizations_detailed, leaving ambiguity about when to use this vs alternatives.

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?

The description provides no guidance on when to use this tool versus similar list tools or alternatives like ninja_get_organization (single) or ninja_get_organizations_detailed (detailed). No usage context or exclusions are mentioned.

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