Skip to main content
Glama

get_organization

Retrieve organization details including contact information, assigned tags, and policy configurations using the NinjaOne organization ID.

Instructions

Get detailed information about a specific organization by its ID, including contact info, tags, and policy assignments.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
organization_idYesNinjaOne organization ID

Implementation Reference

  • Handler for 'get_organization' tool. Makes API call to /organization/{id} endpoint and returns JSON result or error.
    server.tool(
      "get_organization",
      "Get detailed information about a specific organization by its ID, including contact info, tags, and policy assignments.",
      {
        organization_id: z.number().describe("NinjaOne organization ID"),
      },
      async ({ organization_id }) => {
        try {
          const result = await client.get(`/organization/${organization_id}`);
          return toolResult(JSON.stringify(result, null, 2));
        } catch (error) {
          return toolResult(
            `Error fetching organization: ${error}`,
            true,
          );
        }
      },
    );
  • Zod schema defining the input parameter for get_organization tool - organization_id as a required number.
    {
      organization_id: z.number().describe("NinjaOne organization ID"),
    },
  • src/index.ts:37-37 (registration)
    Registration of organization tools including get_organization in the main server setup.
    registerOrganizationTools(server, client);
  • Helper function to format tool responses in MCP format with content array and optional error flag.
    function toolResult(text: string, isError = false) {
      return { content: [{ type: "text" as const, text }], isError };
    }

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