ninja_create_organization_location
Create a location for an organization by specifying ID, name, address, city, state, country, and postal code.
Instructions
Create a new location for an organization.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Organization ID | |
| name | Yes | Location name | |
| description | No | Location description | |
| address | No | Street address | |
| city | No | City | |
| state | No | State or province | |
| country | No | Country code (e.g. US) | |
| zipCode | No | Postal/ZIP code |
Implementation Reference
- src/tools/organizations.ts:151-152 (handler)Handler function for ninja_create_organization_location - makes a POST request to /organization/{id}/locations with the request body (name, description, address, etc.)
handler: async ({ id, ...body }, client: NinjaOneClient) => client.post(`/organization/${id}/locations`, body), - src/tools/organizations.ts:136-149 (schema)Input schema for ninja_create_organization_location - requires 'id' (number) and 'name' (string), with optional fields: description, address, city, state, country, zipCode
inputSchema: { type: 'object', required: ['id', 'name'], properties: { id: { type: 'number', description: 'Organization ID' }, name: { type: 'string', description: 'Location name' }, description: { type: 'string', description: 'Location description' }, address: { type: 'string', description: 'Street address' }, city: { type: 'string', description: 'City' }, state: { type: 'string', description: 'State or province' }, country: { type: 'string', description: 'Country code (e.g. US)' }, zipCode: { type: 'string', description: 'Postal/ZIP code' }, }, }, - src/tools/organizations.ts:132-152 (registration)Tool registration as part of organizationTools array - the tool object with name: 'ninja_create_organization_location' and its handler
{ tool: { name: 'ninja_create_organization_location', description: 'Create a new location for an organization.', inputSchema: { type: 'object', required: ['id', 'name'], properties: { id: { type: 'number', description: 'Organization ID' }, name: { type: 'string', description: 'Location name' }, description: { type: 'string', description: 'Location description' }, address: { type: 'string', description: 'Street address' }, city: { type: 'string', description: 'City' }, state: { type: 'string', description: 'State or province' }, country: { type: 'string', description: 'Country code (e.g. US)' }, zipCode: { type: 'string', description: 'Postal/ZIP code' }, }, }, }, handler: async ({ id, ...body }, client: NinjaOneClient) => client.post(`/organization/${id}/locations`, body), - src/tools/index.ts:13-24 (registration)ALL_TOOLS array that exports organizationTools (which contains the tool) to the main server registration
export const ALL_TOOLS = [ ...deviceTools, ...organizationTools, ...alertTools, ...activityTools, ...ticketingTools, ...queryTools, ...policyTools, ...userTools, ...backupTools, ...systemTools, ]; - src/index.ts:24-24 (registration)Main server registration - toolMap built from ALL_TOOLS, mapping tool name to handler, used in CallToolRequestSchema handler
const toolMap = new Map(ALL_TOOLS.map((def) => [def.tool.name, def.handler]));