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
| Name | Required | Description | Default |
|---|---|---|---|
| organization_id | Yes | NinjaOne organization ID |
Implementation Reference
- src/tools/organizations.ts:117-129 (handler)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, ); } }, - src/tools/organizations.ts:115-115 (schema)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"), - src/tools/organizations.ts:111-130 (registration)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, ); } }, );