feat(mcp): expose action run logs as get_action_run_logs (FJ-61) #79

Merged
David merged 1 commit from feat/FJ-61-mcp-action-run-logs into main 2026-07-19 23:47:36 +02:00
Owner

Closes FJ-61.

The CLI has shipped fj actions logs since FJ-22, but the MCP server exposed no way to read an action run's logs: a client could see a run failed via list_action_tasks and never find out why.

  • New READ-tier tool get_action_run_logs { owner, repo, run_number, job? }, delegating to fj_core::actions::action_run_logs so no REST logic is reimplemented in the MCP layer.
  • JobLog derives Serialize; the tool returns [{ name, status, log }], matching fj actions logs --json field names.
  • Listed in the read-tool enumeration inside with_instructions(...).
  • Optional job narrows the result to a single job, the escape hatch for unbounded log bodies landing whole in the caller's context.

Sweep

Comparing every CLI actions read capability against the MCP surface: tasks (compliant), variables list/get repo+org (compliant), secrets list (compliant), logs (was violating, fixed here), artifacts list + artifact download (violating, out of scope, tracked in FJ-62). Dispatch is EDIT tier and already exposed.

just pre-commit passes. The MCP-reuse contract grep (cargo tree -p fj-client -p fj-core -e normal | grep -E 'clap|crossterm|fluent') returns nothing.

Closes FJ-61. The CLI has shipped `fj actions logs` since FJ-22, but the MCP server exposed no way to read an action run's logs: a client could see a run failed via `list_action_tasks` and never find out why. - New READ-tier tool `get_action_run_logs { owner, repo, run_number, job? }`, delegating to `fj_core::actions::action_run_logs` so no REST logic is reimplemented in the MCP layer. - `JobLog` derives `Serialize`; the tool returns `[{ name, status, log }]`, matching `fj actions logs --json` field names. - Listed in the read-tool enumeration inside `with_instructions(...)`. - Optional `job` narrows the result to a single job, the escape hatch for unbounded log bodies landing whole in the caller's context. ## Sweep Comparing every CLI actions read capability against the MCP surface: tasks (compliant), variables list/get repo+org (compliant), secrets list (compliant), logs (was violating, fixed here), artifacts list + artifact download (violating, out of scope, tracked in FJ-62). Dispatch is EDIT tier and already exposed. `just pre-commit` passes. The MCP-reuse contract grep (`cargo tree -p fj-client -p fj-core -e normal | grep -E 'clap|crossterm|fluent'`) returns nothing.
feat(mcp): expose action run logs as get_action_run_logs
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 3m7s
Create release / Create release from merged PR (pull_request) Has been skipped
2dde9201a1
The CLI has shipped `fj actions logs` since FJ-22, but the MCP server exposed no way to read an action run's logs: a client could see that a run failed via list_action_tasks and never find out why. Add a READ-tier get_action_run_logs tool delegating to fj_core::actions::action_run_logs, so no REST logic is reimplemented in the MCP layer.

JobLog now derives Serialize so the tool returns [{ name, status, log }], matching the field names of `fj actions logs --json`. The optional job parameter narrows the result to a single job, which is the escape hatch for unbounded log bodies landing whole in the caller's context.

#FJ-61
David scheduled this pull request to auto merge when all checks succeed 2026-07-19 23:46:43 +02:00
David merged commit ca839a9121 into main 2026-07-19 23:47:36 +02:00
David deleted branch feat/FJ-61-mcp-action-run-logs 2026-07-19 23:47:36 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
pandoras-box/forgejo-cli!79
No description provided.