Skip to main content
Glama

ninja_get_ticket_log

Fetch the activity and change log entries for a ticket. Use the ticket ID, and optionally set page size or pagination cursor to control results.

Instructions

Get the activity and change log entries for a ticket.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ticketIdYesTicket ID
pageSizeNoMax entries to return
afterNoPagination cursor

Implementation Reference

  • The handler function for ninja_get_ticket_log. Makes a GET request to /ticketing/ticket/{ticketId}/log-entry, passing pagination params (pageSize, after) after stripping null/empty values via the clean() utility.
      handler: async ({ ticketId, ...params }, client: NinjaOneClient) =>
        client.get(`/ticketing/ticket/${ticketId}/log-entry`, clean(params)),
    },
  • The input schema for ninja_get_ticket_log. Requires ticketId (number), with optional pageSize (number) and after (number) for pagination.
    inputSchema: {
      type: 'object',
      required: ['ticketId'],
      properties: {
        ticketId: { type: 'number', description: 'Ticket ID' },
        pageSize: { type: 'number', description: 'Max entries to return' },
        after: { type: 'number', description: 'Pagination cursor' },
      },
    },
  • The tool definition entry in the ticketingTools array. The tool is named 'ninja_get_ticket_log' with its schema and handler bundled together as a ToolDef object.
    {
      tool: {
        name: 'ninja_get_ticket_log',
        description: 'Get the activity and change log entries for a ticket.',
        inputSchema: {
          type: 'object',
          required: ['ticketId'],
          properties: {
            ticketId: { type: 'number', description: 'Ticket ID' },
            pageSize: { type: 'number', description: 'Max entries to return' },
            after: { type: 'number', description: 'Pagination cursor' },
          },
        },
      },
      handler: async ({ ticketId, ...params }, client: NinjaOneClient) =>
        client.get(`/ticketing/ticket/${ticketId}/log-entry`, clean(params)),
    },
  • ALL_TOOLS aggregates all tool definitions. ticketingTools (which includes ninja_get_ticket_log) is spread into this array, which is used by the MCP server to register tools.
    export const ALL_TOOLS = [
      ...deviceTools,
      ...organizationTools,
      ...alertTools,
      ...activityTools,
      ...ticketingTools,
      ...queryTools,
      ...policyTools,
      ...userTools,
      ...backupTools,
      ...systemTools,
    ];
  • src/index.ts:24-60 (registration)
    The MCP server registration in src/index.ts. The toolMap is built from ALL_TOOLS, mapping each tool name to its handler. The CallToolRequestSchema handler looks up the tool by name (e.g., 'ninja_get_ticket_log') and calls its handler.
    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);
    
      if (!handler) {
        return {
          content: [{ type: 'text', text: `Unknown tool: ${name}` }],
          isError: true,
        };
      }
    
      try {
        const result = await handler(
          (args ?? {}) as Record<string, unknown>,
          ninjaClient,
        );
        return {
          content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
        };
      } catch (err) {
        return {
          content: [{ type: 'text', text: err instanceof Error ? err.message : String(err) }],
          isError: true,
        };
      }
    });
Behavior2/5

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

No annotations are provided, and the description does not disclose behavioral details such as pagination behavior, ordering of entries, or what constitutes 'activity and change log.' The agent is left without important context on how the tool operates.

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 with no unnecessary words. It is front-loaded with the purpose and is perfectly concise for a simple retrieval tool.

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

Completeness3/5

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

Given the lack of an output schema, the description should ideally explain the structure of the returned log entries. It only vaguely mentions 'activity and change log entries,' which is insufficient for an agent to understand the exact output. However, the tool is relatively simple and the parameter schema is well-documented, so the completeness is adequate but not optimal.

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?

The input schema provides complete descriptions for all three parameters (ticketId, pageSize, after). The description adds no additional meaning beyond what the schema already conveys, so the baseline score of 3 is appropriate.

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 activity and change log entries for a ticket, using a specific verb and resource. It distinguishes itself from sibling tools like ninja_get_ticket (which fetches ticket details) and ninja_get_ticket_attributes (which gets custom fields).

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 is provided on when to use this tool versus alternatives like ninja_get_ticket or ninja_get_ticket_attributes. The description does not mention prerequisites, limitations, or contrast with similar tools.

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