Add tags and team membership to users tool, bump SDK to v2026.5.6#113
Add tags and team membership to users tool, bump SDK to v2026.5.6#113saditya370 wants to merge 1 commit intomainfrom
Conversation
1120b41 to
103ff7e
Compare
103ff7e to
6a3d0ea
Compare
| func convertToServiceFilterInput(filter componentFilter) (opslevel.ServiceFilterInput, error) { | ||
| // Handle simple filter | ||
| if filter.Key != "" && filter.Type != "" { | ||
| key := opslevel.ServiceFilterEnum(filter.Key) |
There was a problem hiding this comment.
is this assignment necessary?
There was a problem hiding this comment.
replaced the named-variable pattern with a small local ptr[T any](v T) *T helper for convertToServiceFilterInput. The SDK's RefOf returns *Nullable[T] which doesn't fit ServiceFilterInput's *ServiceFilterEnum/*TypeEnum/*ConnectiveEnum fields, so a custom helper was the cleanest way to keep the struct literals inline without the named vars
| mcp.NewTool( | ||
| "users", | ||
| mcp.WithDescription("Get all the user names, e-mail addresses and metadata for the OpsLevel account. Users are the people in OpsLevel. Only use this if you need to search all users."), | ||
| mcp.WithDescription("Get all users in the OpsLevel account along with their tags and team memberships. Users are the people in OpsLevel. Each user includes their tags (as 'key:value' strings) and the teams they belong to (id and alias), which is useful for answering questions like 'which team does this user belong to?' or 'which users are tagged as on-call leads?'. Only use this if you need to search all users."), |
There was a problem hiding this comment.
Was this prompt tested/compared to any other prompts? I'm curious about how this would perform against something a little less verbose.
There was a problem hiding this comment.
Tried both versions in Claude Desktop with 6 test queries — 4 that should hit users and 2 that shouldn't. Both scored 6/6, so going with the shorter one to match the style of the other tool descriptions here.
Heads up: not a real benchmark — queries shared context within each run, so this is more of a sanity check than rigorous testing. If we care about prompt changes going forward, reviving mcp-eval/ or scripting against the API directly would be the way.
6a3d0ea to
c22aebf
Compare
Summary
The
usersMCP tool returned name, email, contacts, and role but omitted tags and team memberships — both populated in OpsLevel and required for incident-routing and on-call queries (OLX use case: "which users are tagged as on-call leads?", "which team does this user belong to?"). This PR wires the now-availableUser.TagsandUser.TeamsConnectionfields (added in opslevel-go v2026.5.6) into the tool response, and bumps the SDK from v2025 to v2026.Changes
src/cmd/root.goUsers tool (the actual feature)
serializedUserandserializedTeamReftypes — keeps the JSON output tight: tags as[]stringof"key:value", teams as[]{Id, Alias}.usershandler now mapsclient.ListUsers(...)results throughserializedUserinstead of returning raw SDK nodes. Tags and teams are pulled fromnode.Tags.Nodesandnode.TeamsConnection.Nodes.v2026 bump fallout
github.com/opslevel/opslevel-go/v2025→/v2026.convertToServiceFilterInputupdated for v2026'sServiceFilterInputshape change:Keyis now*ServiceFilterEnum(wasPredicateKeyEnumvalue).Typeis now*TypeEnum(wasPredicateTypeEnumvalue).Predicatesis now[]ServiceFilterInput(was*[]ServiceFilterInput).Wire behavior of the
componentstool is unchanged.src/cmd/client.gov2025→v2026.src/go.mod/src/go.sumgithub.com/opslevel/opslevel-go/v2025 v2025.7.28→github.com/opslevel/opslevel-go/v2026 v2026.5.6.go mod tidy:iso8601 v1.6.0→v1.7.0,hasura/go-graphql-client v0.14.4→v0.15.1,cobra v1.9.1→v1.10.1, plus minorgolang.org/x/*updates.Test plan
go build ./...passesgo vet ./...cleanuserstool against a real account, verifytagsandteamspopulatecomponentstool (filter conversion was rewritten for v2026's pointer-typed filter shape)