Skip to main content
Glama

my-project-repo_get_operation_logs

Retrieve operation logs for Git repository management to track batch commits, pushes, and synchronization activities across multiple repositories.

Instructions

[My Awesome Project] Get operation logs

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoLimit count, default 50
offsetNoOffset, default 0

Implementation Reference

  • Handler function that implements the core logic of 'my-project-repo_get_operation_logs' tool. It validates input parameters (limit, offset), slices the operationLogs array accordingly, and returns paginated logs with metadata.
    // Get operation logs
    async get_operation_logs(params) {
      const { limit = 50, offset = 0 } = params || {};
    
      // Validate parameters
      if (typeof limit !== 'number' || limit < 1 || limit > 1000) {
        throw new Error('limit parameter must be between 1-1000');
      }
    
      if (typeof offset !== 'number' || offset < 0) {
        throw new Error('offset parameter must be greater than or equal to 0');
      }
    
      // Return logs from memory
      const logs = operationLogs.slice(offset, offset + limit);
    
      return {
        logs: logs,
        total: operationLogs.length,
        limit: limit,
        offset: offset,
        hasMore: offset + limit < operationLogs.length
      };
    }
  • Registration of the tool in the 'tools/list' MCP method. Dynamically constructs the tool name as 'my-project-repo_get_operation_logs' using REPO_NAME prefix via getToolName, includes description and input schema.
    // Add get_operation_logs tool
    tools.push({
      name: getToolName('get_operation_logs'),
      description: getToolDescription('Get operation logs'),
      inputSchema: {
        type: 'object',
        properties: {
          limit: {
            type: 'number',
            description: 'Limit count, default 50'
          },
          offset: {
            type: 'number',
            description: 'Offset, default 0'
          }
        }
      }
    });
  • JSON schema for tool inputs, defining optional pagination parameters 'limit' (1-1000) and 'offset' (>=0). Used in registration and validation.
    inputSchema: {
      type: 'object',
      properties: {
        limit: {
          type: 'number',
          description: 'Limit count, default 50'
        },
        offset: {
          type: 'number',
          description: 'Offset, default 0'
        }
      }
    }
  • Utility function that records all tool calls (including this one) to in-memory operationLogs array and file log. Called after every tool execution.
    const logRequest = (method, params, result, error = null) => {
      const logEntry = {
        id: Date.now(),
        method,
        params: JSON.stringify(params),
        result: result ? JSON.stringify(result) : null,
        error: error ? error.toString() : null,
        created_at: new Date().toISOString()
      };
    
      operationLogs.unshift(logEntry);
      if (operationLogs.length > MAX_LOGS) {
        operationLogs.splice(MAX_LOGS);
      }
    
      // Record request and response data
      const logLine = `${logEntry.created_at} | ${method} | ${logEntry.params} | ${error || 'SUCCESS'} | RESPONSE: ${logEntry.result || 'null'}\n`;
    
      try {
        ensureLogDir();
        const { fullPath } = getLogConfig();
        fs.appendFileSync(fullPath, logLine, 'utf8');
      } catch (err) {
        console.error('Failed to write log file:', err.message);
      }
    };
  • Global in-memory array storing up to 1000 recent operation logs, which the handler queries and paginates.
    // In-memory log storage
    const operationLogs = [];
    const MAX_LOGS = 1000;
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It only states what the tool does ('Get operation logs') without describing what the logs contain, their format, whether this is a read-only operation, potential rate limits, authentication requirements, or what happens when parameters are omitted. For a tool with no annotation coverage, this is insufficient behavioral context.

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

Conciseness4/5

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

The description is extremely concise at just 5 words, which is appropriately sized for a simple retrieval tool. However, it's arguably too brief given the lack of behavioral context needed when annotations are absent. The structure is front-loaded with the core purpose but lacks supporting details.

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 annotations, no output schema, and a description that only states the basic purpose, this is incomplete for effective tool usage. The agent needs to know what 'operation logs' contain, their format, how they differ from push history, and what the tool returns. The description doesn't compensate for the lack of structured metadata.

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 has 100% description coverage with clear documentation of both parameters (limit and offset). The description adds no additional parameter information beyond what's already in the schema. According to scoring rules, when schema_description_coverage is high (>80%), the baseline is 3 even with no param info in the description.

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 states the tool's purpose as 'Get operation logs' which is a clear verb+resource combination. However, it doesn't specify what 'operation logs' contain or distinguish this from sibling tools like 'get_push_history' which likely retrieves similar historical data. The description is vague about the specific scope of operations being logged.

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?

The description provides no guidance on when to use this tool versus alternatives. There's no mention of when this should be used instead of 'get_push_history' or 'mgit_push', nor any context about what types of operations are included in these logs versus push history. The agent receives no usage differentiation.

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/liliangshan/mcp-server-mgit'

If you have feedback or need assistance with the MCP directory API, please join our Discord server