Skip to content

Commit b747083

Browse files
authored
Merge pull request #169 from buildkite/fix_remove_redundant_information_from_build_tool
fix: removed a bunch of high token fields from jobs
2 parents c7663d9 + 0f62af1 commit b747083

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

pkg/buildkite/builds.go

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ type BuildWithSummary struct {
6363
type ListBuildsArgs struct {
6464
OrgSlug string `json:"org_slug"`
6565
PipelineSlug string `json:"pipeline_slug"`
66-
Branch string `json:"branch"` // existing
67-
State string `json:"state"` // NEW: running, passed, failed, etc.
68-
Commit string `json:"commit"` // NEW: specific commit SHA
69-
Creator string `json:"creator"` // NEW: filter by build creator
66+
Branch string `json:"branch"`
67+
State string `json:"state"`
68+
Commit string `json:"commit"`
69+
Creator string `json:"creator"`
7070
DetailLevel string `json:"detail_level"` // summary, detailed, full
7171
Page int `json:"page"`
7272
PerPage int `json:"per_page"`
@@ -478,6 +478,17 @@ func GetBuild(client BuildsClient) (tool mcp.Tool, handler mcp.TypedToolHandlerF
478478
case "full":
479479
// Full level returns build with filtered jobs
480480
buildCopy := build
481+
buildCopy.Pipeline = nil // reduce size by excluding pipeline details
482+
483+
// Strip fields from jobs
484+
for i := range jobs {
485+
jobs[i].WebURL = "" // not useful in MCP
486+
jobs[i].RawLogsURL = "" // provided by another tool
487+
jobs[i].ArtifactsURL = "" // provided by another tool
488+
jobs[i].LogsURL = "" // deprecated
489+
jobs[i].GraphQLID = "" // random id not useful in the MCP
490+
}
491+
481492
buildCopy.Jobs = jobs
482493
result = buildCopy
483494
default:

0 commit comments

Comments
 (0)