Skip to main content
Glama

ninja_get_organization_custom_fields

Retrieve custom field values for an organization, with the option to include inherited values.

Instructions

Get custom field values for an organization.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesOrganization ID
withInheritanceNoInclude inherited custom field values

Implementation Reference

  • Handler function for ninja_get_organization_custom_fields. It destructures 'id' from args and passes remaining params (e.g., withInheritance) as query parameters to GET /organization/{id}/custom-fields with undefined/empty values cleaned out.
    handler: async ({ id, ...params }, client: NinjaOneClient) =>
      client.get(`/organization/${id}/custom-fields`, clean(params)),
  • Input schema for ninja_get_organization_custom_fields. Requires 'id' (number) and optionally accepts 'withInheritance' (boolean). Defined as part of the Tool object within the ToolDef array entry.
    tool: {
      name: 'ninja_get_organization_custom_fields',
      description: 'Get custom field values for an organization.',
      inputSchema: {
        type: 'object',
        required: ['id'],
        properties: {
          id: { type: 'number', description: 'Organization ID' },
          withInheritance: {
            type: 'boolean',
            description: 'Include inherited custom field values',
          },
        },
      },
  • Registration entry in the organizationTools array. The tool object contains name 'ninja_get_organization_custom_fields', description, and inputSchema. Its handler is registered alongside.
    {
      tool: {
        name: 'ninja_get_organization_custom_fields',
        description: 'Get custom field values for an organization.',
        inputSchema: {
          type: 'object',
          required: ['id'],
          properties: {
            id: { type: 'number', description: 'Organization ID' },
            withInheritance: {
              type: 'boolean',
              description: 'Include inherited custom field values',
            },
          },
        },
      },
      handler: async ({ id, ...params }, client: NinjaOneClient) =>
        client.get(`/organization/${id}/custom-fields`, clean(params)),
  • ALL_TOOLS array spreads organizationTools (which includes ninja_get_organization_custom_fields) into the combined tool list for registration with the MCP server.
    export const ALL_TOOLS = [
      ...deviceTools,
      ...organizationTools,
      ...alertTools,
      ...activityTools,
      ...ticketingTools,
      ...queryTools,
      ...policyTools,
      ...userTools,
      ...backupTools,
      ...systemTools,
    ];
  • src/index.ts:24-37 (registration)
    toolMap created from ALL_TOOLS mapping tool names to handlers. The CallToolRequestSchema handler looks up the handler by name (e.g., 'ninja_get_organization_custom_fields') and invokes it.
    const toolMap = new Map(ALL_TOOLS.map((def) => [def.tool.name, def.handler]));
    
    const server = new Server(
      { name: 'ninjaone-mcp', version: '1.0.0' },
      { capabilities: { tools: {} } },
    );
    
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: ALL_TOOLS.map((def) => def.tool),
    }));
    
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: args } = request.params;
      const handler = toolMap.get(name);
Behavior2/5

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

No annotations are provided, so the description must fully convey behavioral traits. It implies a read-only operation ('Get') but does not disclose what happens if the organization ID is invalid, whether data is paginated, or any side effects. The description is too minimal to ensure agent awareness of important behavioral aspects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with 7 words, achieving maximal conciseness. It front-loads the essential verb and resource, with no redundant or unnecessary information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the absence of annotations and output schema, the description should provide more context about the tool's behavior, scope (organization-level vs device-level), and what the response contains. It fails to differentiate from sibling tools or explain the 'withInheritance' parameter's effect, leaving the agent with insufficient information for correct invocation.

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?

With 100% schema coverage, the input schema already documents both parameters ('id' and 'withInheritance'). The description does not add meaningful context beyond the schema, such as what 'inherited' means or how values are structured. Baseline score of 3 is appropriate since the schema handles parameter documentation adequately.

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 verb 'Get' and the resource 'custom field values for an organization', making the tool's purpose immediately understandable. However, it does not explicitly differentiate from sibling tools like 'ninja_get_device_custom_fields' or 'ninja_query_custom_fields', relying on the tool name for distinction.

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?

There is no guidance on when to use this tool versus alternative custom field tools. No mention of prerequisites, typical use cases, or scenarios where another tool would be more appropriate. The description is purely functional without usage context.

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