MCPcopy
hub / github.com/github/github-mcp-server / ActionsGetJobLogs

Function ActionsGetJobLogs

pkg/github/actions.go:647–771  ·  view source on GitHub ↗

ActionsGetJobLogs returns the tool and handler for getting workflow job logs.

(t translations.TranslationHelperFunc)

Source from the content-addressed store, hash-verified

645
646// ActionsGetJobLogs returns the tool and handler for getting workflow job logs.
647func ActionsGetJobLogs(t translations.TranslationHelperFunc) inventory.ServerTool {
648 tool := NewTool(
649 ToolsetMetadataActions,
650 mcp.Tool{
651 Name: "get_job_logs",
652 Description: t("TOOL_GET_JOB_LOGS_CONSOLIDATED_DESCRIPTION", `Get logs for GitHub Actions workflow jobs.
653Use this tool to retrieve logs for a specific job or all failed jobs in a workflow run.
654For single job logs, provide job_id. For all failed jobs in a run, provide run_id with failed_only=true.
655`),
656 Annotations: &mcp.ToolAnnotations{
657 Title: t("TOOL_GET_JOB_LOGS_CONSOLIDATED_USER_TITLE", "Get GitHub Actions workflow job logs"),
658 ReadOnlyHint: true,
659 },
660 InputSchema: &jsonschema.Schema{
661 Type: "object",
662 Properties: map[string]*jsonschema.Schema{
663 "owner": {
664 Type: "string",
665 Description: "Repository owner",
666 },
667 "repo": {
668 Type: "string",
669 Description: "Repository name",
670 },
671 "job_id": {
672 Type: "number",
673 Description: "The unique identifier of the workflow job. Required when getting logs for a single job.",
674 },
675 "run_id": {
676 Type: "number",
677 Description: "The unique identifier of the workflow run. Required when failed_only is true to get logs for all failed jobs in the run.",
678 },
679 "failed_only": {
680 Type: "boolean",
681 Description: "When true, gets logs for all failed jobs in the workflow run specified by run_id. Requires run_id to be provided.",
682 },
683 "return_content": {
684 Type: "boolean",
685 Description: "Returns actual log content instead of URLs",
686 },
687 "tail_lines": {
688 Type: "number",
689 Description: "Number of lines to return from the end of the log",
690 Default: json.RawMessage(`500`),
691 },
692 },
693 Required: []string{"owner", "repo"},
694 },
695 },
696 []scopes.Scope{scopes.Repo},
697 func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
698 owner, err := RequiredParam[string](args, "owner")
699 if err != nil {
700 return utils.NewToolResultError(err.Error()), nil, nil
701 }
702 repo, err := RequiredParam[string](args, "repo")
703 if err != nil {
704 return utils.NewToolResultError(err.Error()), nil, nil

Callers 4

Test_ActionsGetJobLogsFunction · 0.85
AllToolsFunction · 0.85

Calls 9

NewToolResultErrorFunction · 0.92
NewToolFunction · 0.85
OptionalIntParamFunction · 0.85
handleFailedJobLogsFunction · 0.85
handleSingleJobLogsFunction · 0.85
GetClientMethod · 0.65
GetContentWindowSizeMethod · 0.65
ErrorMethod · 0.45

Tested by 3

Test_ActionsGetJobLogsFunction · 0.68