Skip to main content
Glama

get_logs

Retrieve process logs from terminal sessions to monitor application behavior and troubleshoot issues. Specify a process identifier to access recent log entries.

Instructions

Get logs from a process

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesProcess identifier
linesNoNumber of lines to return (optional)

Implementation Reference

  • The getLogs function in ProcessManager class handles retrieving log contents from a file associated with a process.
    async getLogs(input: { id: string; lines?: number }): Promise<{ id: string; logs: string }> {
      const logFile = this.logFiles.get(input.id);
    
      if (!logFile) {
        throw new Error(`Process '${input.id}' not found`);
      }
    
      if (!fs.existsSync(logFile)) {
        throw new Error(`No logs found for process '${input.id}'`);
      }
    
      const logs = await this.logService.readLog(logFile, input.lines);
      return { id: input.id, logs };
    }
  • src/index.ts:53-63 (registration)
    Definition of the get_logs tool in the MCP server registration.
      name: 'get_logs',
      description: 'Get logs from a process',
      inputSchema: {
        type: 'object',
        properties: {
          id: { type: 'string', description: 'Process identifier' },
          lines: { type: 'number', description: 'Number of lines to return (optional)' },
        },
        required: ['id'],
      },
    },
  • The server request handler calls processManager.getLogs when the 'get_logs' tool is invoked.
    case 'get_logs': {
      const result = await processManager.getLogs(args as any);
      return { content: [{ type: 'text', text: JSON.stringify(result) }] };
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states 'Get logs' but doesn't specify if this is read-only, requires permissions, has rate limits, returns structured or raw data, or handles errors. For a tool with no annotations, this leaves significant gaps in understanding its behavior and constraints.

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 a single, efficient sentence with no wasted words, making it easy to parse. However, it could be more front-loaded with key details (e.g., scope or differentiation), but its brevity is appropriate for basic clarity.

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 tool's complexity (2 parameters, no output schema, no annotations), the description is incomplete. It doesn't explain what the logs contain, how they're formatted, or any behavioral traits, leaving the agent under-informed for proper invocation and result handling.

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, clearly documenting 'id' as 'Process identifier' and 'lines' as 'Number of lines to return (optional)'. The description adds no additional meaning beyond this, such as format examples or constraints, but the schema provides adequate baseline information.

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 'Get logs from a process' clearly states the verb ('Get') and resource ('logs from a process'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'search_logs' or specify what type of logs or scope (e.g., recent, all, error logs), leaving it somewhat vague compared to alternatives.

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 like 'search_logs' or 'list_processes'. It doesn't mention prerequisites (e.g., needing a process ID from 'list_processes') or exclusions (e.g., not for real-time monitoring), leaving the agent with minimal context for tool selection.

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/h004888/mcp_terminal_process'

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