Skip to main content
Glama

ninja_list_contacts

List all contacts from your NinjaOne account. Supports pagination with page size and cursor (last contact ID).

Instructions

List all contacts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageSizeNoMax results to return
afterNoLast contact ID for pagination

Implementation Reference

  • The handler function for ninja_list_contacts that calls client.get('/contacts', clean(args)) to fetch contacts from the NinjaOne API.
    handler: async (args, client: NinjaOneClient) => client.get('/contacts', clean(args)),
  • Input schema for ninja_list_contacts: accepts optional pageSize (number) and after (last contact ID for pagination) parameters.
    inputSchema: {
      type: 'object',
      properties: {
        pageSize: { type: 'number', description: 'Max results to return' },
        after: { type: 'number', description: 'Last contact ID for pagination' },
      },
    },
  • Tool definition registration as part of the userTools array. The tool name 'ninja_list_contacts' is registered with its description, schema, and handler.
    {
      tool: {
        name: 'ninja_list_contacts',
        description: 'List all contacts.',
        inputSchema: {
          type: 'object',
          properties: {
            pageSize: { type: 'number', description: 'Max results to return' },
            after: { type: 'number', description: 'Last contact ID for pagination' },
          },
        },
      },
      handler: async (args, client: NinjaOneClient) => client.get('/contacts', clean(args)),
    },
  • userTools (which contains ninja_list_contacts) is spread into the ALL_TOOLS array, making it available to the MCP server.
    export const ALL_TOOLS = [
      ...deviceTools,
      ...organizationTools,
      ...alertTools,
      ...activityTools,
      ...ticketingTools,
      ...queryTools,
      ...policyTools,
      ...userTools,
      ...backupTools,
      ...systemTools,
    ];
  • The clean() utility function used by the handler to filter out null/empty arguments before passing them as query parameters.
    // eslint-disable-next-line @typescript-eslint/no-explicit-any
    export function clean(args: Record<string, any>): Record<string, unknown> {
      return Object.fromEntries(
        Object.entries(args).filter(([, v]) => v != null && v !== ''),
      );
    }
Behavior2/5

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

No annotations provided, so the description must cover behavior. It implies a read operation but does not disclose details like pagination, permission requirements, or system-wide scope.

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

Conciseness2/5

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

Three words is excessively brief; it lacks substantive information and does not earn its place as a standalone description.

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 no output schema, the description should mention return values or pagination. It only states 'List all contacts' without details, leaving the agent uninformed about response structure.

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?

Input schema has 100% coverage with descriptions for both parameters (pageSize, after). The description adds no further meaning beyond what the schema already provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'List all contacts' clearly states the verb and resource, but it closely mirrors the tool name and does not differentiate from many sibling list tools like ninja_list_devices or ninja_list_technicians.

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?

No guidance on when to use this tool versus alternatives. It does not specify any context, prerequisites, or exclusions.

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