Skip to main content
Glama

get_organization_policies

Retrieve policy assignments for a NinjaOne organization to manage security settings and compliance requirements.

Instructions

Get the policy assignments for a specific organization.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
organization_idYesNinjaOne organization ID

Implementation Reference

  • Handler function for 'get_organization_policies' tool that makes an API call to fetch policy assignments for a specific organization using the NinjaOne client
    async ({ organization_id }) => {
      try {
        const results = await client.get(
          `/organization/${organization_id}/policies`,
        );
        return toolResult(JSON.stringify(results, null, 2));
      } catch (error) {
        return toolResult(
          `Error fetching organization policies: ${error}`,
          true,
        );
      }
    },
  • Zod schema definition for the 'get_organization_policies' tool input parameter - requires organization_id as a number
    organization_id: z.number().describe("NinjaOne organization ID"),
  • Complete registration of 'get_organization_policies' tool with the MCP server, including name, description, schema, and handler function
    server.tool(
      "get_organization_policies",
      "Get the policy assignments for a specific organization.",
      {
        organization_id: z.number().describe("NinjaOne organization ID"),
      },
      async ({ organization_id }) => {
        try {
          const results = await client.get(
            `/organization/${organization_id}/policies`,
          );
          return toolResult(JSON.stringify(results, null, 2));
        } catch (error) {
          return toolResult(
            `Error fetching organization policies: ${error}`,
            true,
          );
        }
      },
    );

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