Skip to main content
Glama

ninja_get_organization_locations

Retrieve all locations for an organization by providing its ID.

Instructions

Get all locations for an organization.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesOrganization ID

Implementation Reference

  • The handler function for ninja_get_organization_locations. It extracts the 'id' from args and makes a GET request to /organization/{id}/locations using the NinjaOneClient.
    handler: async ({ id }, client: NinjaOneClient) =>
      client.get(`/organization/${id}/locations`),
  • Input schema for ninja_get_organization_locations. Requires a single 'id' parameter (number) representing the Organization ID.
    inputSchema: {
      type: 'object',
      required: ['id'],
      properties: {
        id: { type: 'number', description: 'Organization ID' },
      },
    },
  • The tool definition registration for ninja_get_organization_locations within the organizationTools array. It defines the tool name, description, input schema, and handler.
    {
      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`),
    },
  • The ALL_TOOLS array that aggregates all tool definitions including organizationTools (which contains ninja_get_organization_locations).
    export const ALL_TOOLS = [
      ...deviceTools,
      ...organizationTools,
      ...alertTools,
      ...activityTools,
      ...ticketingTools,
      ...queryTools,
      ...policyTools,
      ...userTools,
      ...backupTools,
      ...systemTools,
    ];
  • src/index.ts:35-59 (registration)
    The MCP server's CallToolRequestSchema handler that looks up tool handlers by name from toolMap (built from ALL_TOOLS) and invokes them.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: args } = request.params;
      const handler = toolMap.get(name);
    
      if (!handler) {
        return {
          content: [{ type: 'text', text: `Unknown tool: ${name}` }],
          isError: true,
        };
      }
    
      try {
        const result = await handler(
          (args ?? {}) as Record<string, unknown>,
          ninjaClient,
        );
        return {
          content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
        };
      } catch (err) {
        return {
          content: [{ type: 'text', text: err instanceof Error ? err.message : String(err) }],
          isError: true,
        };
      }
Behavior2/5

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

No annotations are provided, and the description does not disclose any behavioral aspects like authorization requirements, rate limits, or error handling (e.g., behavior when organization ID is invalid).

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?

The description is a single, clear sentence with no unnecessary words. It is appropriately concise for a simple read operation, though it could benefit from slightly more detail.

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 tool is simple with one parameter and no output schema; the minimal description is functional but lacks context on return format or pagination, which would be helpful for a list endpoint.

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 schema already describes the single parameter 'id' with 100% coverage, so the description adds no extra semantic value beyond the schema. Baseline of 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 action ('Get all locations') and the scope ('for an organization'), distinguishing it from broader list tools like 'ninja_list_locations'. However, it could be more specific about the resource type.

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 on when to use this tool versus alternatives such as 'ninja_list_locations' or 'ninja_create_organization_location'. The agent receives no context about prerequisites or exclusion criteria.

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