Skip to main content
Glama

ninja_list_activities

Get system activity logs filtered by class, date range, type, status, user, or device.

Instructions

Get the system activity log. Filter by class (SYSTEM/DEVICE/USER), date range, type, status, user, or device.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
classNoActivity class filter (default: ALL)
beforeNoReturn activities before this date/time (ISO 8601)
afterNoReturn activities after this date/time (ISO 8601)
olderThanNoReturn activities with ID older than this value (pagination)
newerThanNoReturn activities with ID newer than this value (pagination)
typeNoActivity type filter
statusNoActivity status filter
userNoFilter by technician username
seriesUidNoReturn activities related to a specific alert series UID
dfNoDevice filter expression
pageSizeNoMax results to return (10–1000, default 200)
langNoLanguage tag (e.g. en)
tzNoTime zone tag (e.g. America/Chicago)

Implementation Reference

  • The handler function for ninja_list_activities. Makes a GET request to /activities with cleaned query parameters via the NinjaOneClient.
    handler: async (args, client: NinjaOneClient) => client.get('/activities', clean(args)),
  • Input schema definition for ninja_list_activities, defining all accepted parameters including class filter, date range, pagination, type, status, user, seriesUid, device filter, pageSize, lang, and tz.
    inputSchema: {
      type: 'object',
      properties: {
        class: {
          type: 'string',
          enum: ['SYSTEM', 'DEVICE', 'USER', 'ALL'],
          description: 'Activity class filter (default: ALL)',
        },
        before: {
          type: 'string',
          description: 'Return activities before this date/time (ISO 8601)',
        },
        after: {
          type: 'string',
          description: 'Return activities after this date/time (ISO 8601)',
        },
        olderThan: {
          type: 'number',
          description: 'Return activities with ID older than this value (pagination)',
        },
        newerThan: {
          type: 'number',
          description: 'Return activities with ID newer than this value (pagination)',
        },
        type: { type: 'string', description: 'Activity type filter' },
        status: { type: 'string', description: 'Activity status filter' },
        user: { type: 'string', description: 'Filter by technician username' },
        seriesUid: {
          type: 'string',
          description: 'Return activities related to a specific alert series UID',
        },
        df: { type: 'string', description: 'Device filter expression' },
        pageSize: { type: 'number', description: 'Max results to return (10–1000, default 200)' },
        lang: { type: 'string', description: 'Language tag (e.g. en)' },
        tz: { type: 'string', description: 'Time zone tag (e.g. America/Chicago)' },
      },
    },
  • The tool is defined as part of the activityTools array, which is exported and then aggregated into ALL_TOOLS in src/tools/index.ts and registered with the MCP server in src/index.ts.
    export const activityTools: ToolDef[] = [
      {
        tool: {
          name: 'ninja_list_activities',
          description:
            'Get the system activity log. Filter by class (SYSTEM/DEVICE/USER), date range, type, status, user, or device.',
          inputSchema: {
            type: 'object',
            properties: {
              class: {
                type: 'string',
                enum: ['SYSTEM', 'DEVICE', 'USER', 'ALL'],
                description: 'Activity class filter (default: ALL)',
              },
              before: {
                type: 'string',
                description: 'Return activities before this date/time (ISO 8601)',
              },
              after: {
                type: 'string',
                description: 'Return activities after this date/time (ISO 8601)',
              },
              olderThan: {
                type: 'number',
                description: 'Return activities with ID older than this value (pagination)',
              },
              newerThan: {
                type: 'number',
                description: 'Return activities with ID newer than this value (pagination)',
              },
              type: { type: 'string', description: 'Activity type filter' },
              status: { type: 'string', description: 'Activity status filter' },
              user: { type: 'string', description: 'Filter by technician username' },
              seriesUid: {
                type: 'string',
                description: 'Return activities related to a specific alert series UID',
              },
              df: { type: 'string', description: 'Device filter expression' },
              pageSize: { type: 'number', description: 'Max results to return (10–1000, default 200)' },
              lang: { type: 'string', description: 'Language tag (e.g. en)' },
              tz: { type: 'string', description: 'Time zone tag (e.g. America/Chicago)' },
            },
          },
        },
        handler: async (args, client: NinjaOneClient) => client.get('/activities', clean(args)),
      },
    ];
  • The clean() utility function used by the handler to strip null/empty values from the arguments before passing them as query parameters.
    export function clean(args: Record<string, any>): Record<string, unknown> {
      return Object.fromEntries(
        Object.entries(args).filter(([, v]) => v != null && v !== ''),
      );
    }
  • The NinjaOneClient.get() method that the handler delegates to, performing an authenticated GET request to the NinjaOne API.
    async get<T = unknown>(path: string, params?: Record<string, unknown>): Promise<T> {
      try {
        const res = await this.http.get<T>(path, {
          params,
          headers: await this.authHeader(),
        });
        return res.data;
      } catch (err) {
        throw new Error(`GET ${path} failed: ${apiError(err)}`);
      }
    }
Behavior2/5

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

With no annotations, the description should disclose behavioral traits like pagination (though schema includes olderThan/newerThan), rate limits, or default scope. It mentions 'Get the system activity log' but doesn't specify output format or caveats. The description is underinformative for a data retrieval tool.

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 sentence that efficiently conveys the tool's purpose and key filtering capabilities. It is front-loaded, well-structured, and contains no redundant 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 13 optional parameters and no output schema, the description should explain what the response contains (e.g., list of activity objects with fields). It only lists filters, leaving the return value unclear, which reduces completeness for an agent.

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?

Schema coverage is 100%, so each parameter has a description. The description lists several filters (class, date range, type, status, user, device) but omits others (seriesUid, df, pageSize, lang, tz). It adds moderate context but adds little beyond the schema.

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

Purpose5/5

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

The description clearly states the tool retrieves the system activity log, naming specific filter criteria. It distinguishes itself from sibling list tools like ninja_list_devices or ninja_get_device_activities by focusing on activities and offering a broad filter set.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for retrieving activities with filters, but it does not explicitly state when to use this global log versus device-specific activity logs (e.g., ninja_get_device_activities). It lacks guidance on prerequisites or alternatives.

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