Default MCP third-party list to level 1

Omit level to return direct third parties; pass level to filter
by hierarchy depth. Documented on the tool and filter field.

Signed-off-by: Sacha Al Himdani <sacha@probo.com>
This commit is contained in:
Sacha Al Himdani
2026-07-30 16:19:01 +02:00
parent 573549fcec
commit 41da4bbad1
2 changed files with 8 additions and 3 deletions

View File

@@ -76,7 +76,12 @@ func (r *Resolver) ListThirdPartiesTool(ctx context.Context, req *mcp.CallToolRe
cursor := types.NewCursor(input.Size, input.Cursor, pageOrderBy)
thirdPartyFilter := coredata.NewThirdPartyFilter(nil, input.Level, nil, nil, nil)
level := input.Level
if level == nil {
level = new(1)
}
thirdPartyFilter := coredata.NewThirdPartyFilter(nil, level, nil, nil, nil)
page, err := prb.ThirdParties.ListForOrganizationID(ctx, scope, input.OrganizationID, cursor, thirdPartyFilter)
if err != nil {