Skip to main content
Glama

ninja_list_locations

Retrieve a complete list of locations across all organizations, with optional pagination and filtering by organization.

Instructions

List all locations across all organizations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
afterNoLast location ID for pagination
pageSizeNoMax results to return
ofNoOrganization filter expression

Implementation Reference

  • Handler function that executes the ninja_list_locations tool logic. Calls NinjaOneClient.get('/locations') with cleaned args for pagination/filtering.
      handler: async (args, client: NinjaOneClient) =>
        client.get('/locations', clean(args)),
    },
  • Input schema defining optional parameters: after (pagination), pageSize (limit), of (organization filter).
    inputSchema: {
      type: 'object',
      properties: {
        after: { type: 'number', description: 'Last location ID for pagination' },
        pageSize: { type: 'number', description: 'Max results to return' },
        of: { type: 'string', description: 'Organization filter expression' },
      },
    },
  • Tool definition object registered in the systemTools array, which is exported and bundled into ALL_TOOLS in src/tools/index.ts.
    {
      tool: {
        name: 'ninja_list_locations',
        description: 'List all locations across all organizations.',
        inputSchema: {
          type: 'object',
          properties: {
            after: { type: 'number', description: 'Last location ID for pagination' },
            pageSize: { type: 'number', description: 'Max results to return' },
            of: { type: 'string', description: 'Organization filter expression' },
          },
        },
      },
      handler: async (args, client: NinjaOneClient) =>
        client.get('/locations', clean(args)),
    },
  • Helper utility used by the handler to strip null/empty values from args before passing to client.get().
    export function clean(args: Record<string, any>): Record<string, unknown> {
      return Object.fromEntries(
        Object.entries(args).filter(([, v]) => v != null && v !== ''),
      );
    }
  • Aggregation of all tool definitions including systemTools (which contains ninja_list_locations).
    export const ALL_TOOLS = [
      ...deviceTools,
      ...organizationTools,
      ...alertTools,
      ...activityTools,
      ...ticketingTools,
      ...queryTools,
      ...policyTools,
      ...userTools,
      ...backupTools,
      ...systemTools,
    ];
Behavior2/5

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

No annotations provided. Description only states action without disclosing pagination behavior, rate limits, or read-only nature. Minimal behavioral context beyond the action itself.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, highly concise. However, could include more context without becoming verbose. Scores well for efficiency but lacks depth.

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?

Given high schema coverage but no output schema, description is minimal. Lacks usage context, pagination hints, or relationship to sibling tools. Better description could improve completeness.

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 coverage is 100% (all parameters described). Description adds no additional parameter meaning beyond what schema provides. Baseline score of 3 is appropriate.

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?

Description clearly states 'List all locations across all organizations', specifying verb, resource, and scope. This distinguishes it from sibling 'ninja_get_organization_locations' which likely filters by organization.

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?

Implies use for global location listing, but no explicit guidance on when to use vs alternatives like ninja_get_organization_locations or other list tools. Lacks when-not-to-use or alternative recommendations.

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