Skip to content

Commit c38688e

Browse files
committed
feat: added a prompt to ensure models know to check the user's token org
1 parent b8fc4c1 commit c38688e

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

internal/buildkite/organizations.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,21 @@ func UserTokenOrganization(ctx context.Context, client OrganizationsClient) (too
4242
return mcp.NewToolResultText(string(r)), nil
4343
}
4444
}
45+
46+
func HandleUserTokenOrganizationPrompt(
47+
ctx context.Context,
48+
request mcp.GetPromptRequest,
49+
) (*mcp.GetPromptResult, error) {
50+
return &mcp.GetPromptResult{
51+
Description: "When asked for detail of a users pipelines start by looking up the user's token organization",
52+
Messages: []mcp.PromptMessage{
53+
{
54+
Role: mcp.RoleUser,
55+
Content: mcp.TextContent{
56+
Type: "text",
57+
Text: "When asked for detail of a users pipelines start by looking up the user's token organization",
58+
},
59+
},
60+
},
61+
}, nil
62+
}

internal/commands/stdio.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55

66
"github.com/buildkite/buildkite-mcp-server/internal/buildkite"
7+
"github.com/mark3labs/mcp-go/mcp"
78
"github.com/mark3labs/mcp-go/server"
89
"github.com/rs/zerolog/log"
910
)
@@ -41,5 +42,9 @@ func (c *StdioCmd) Run(ctx context.Context, globals *Globals) error {
4142

4243
s.AddTool(buildkite.UserTokenOrganization(ctx, globals.Client.Organizations))
4344

45+
s.AddPrompt(mcp.NewPrompt("user_token_organization_prompt",
46+
mcp.WithPromptDescription("When asked for detail of a users pipelines start by looking up the user's token organization"),
47+
), buildkite.HandleUserTokenOrganizationPrompt)
48+
4449
return server.ServeStdio(s)
4550
}

0 commit comments

Comments
 (0)