Skip to content

Enhancement: Add log truncation options to get_job_logs tool for improved LLM context efficiency #608

@kehao95

Description

@kehao95

Summary

The get_job_logs tool currently returns complete job logs, which can be extremely long and inefficient when used as MCP tool context for LLMs. Adding log truncation options like tail_lines parameters would help focus on relevant failure information.

Problem

When debugging CI/CD failures using the get_job_logs tool in LLM conversations:

  1. Context Overflow: Complete job logs can easily exceed LLM context limits
  2. Information Overload: Most debugging scenarios only need the final portion where failures occur
  3. Poor User Experience: Long logs make it harder to identify specific failure points

Proposed Solution

Add optional truncation parameters to the get_job_logs tool:

  • tail_lines: Return last N lines (most useful for failure debugging)

Example usage:

{
  "name": "get_job_logs",
  "arguments": {
    "owner": "example",
    "repo": "repo", 
    "job_id": 12345,
    "tail_lines": 100,
    "return_content": true
  }
}

This enhancement aligns with existing concerns about LLM context efficiency, similar to Issue #142 regarding excessive context size.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy