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:
@@ -76,7 +76,12 @@ func (r *Resolver) ListThirdPartiesTool(ctx context.Context, req *mcp.CallToolRe
|
|||||||
|
|
||||||
cursor := types.NewCursor(input.Size, input.Cursor, pageOrderBy)
|
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)
|
page, err := prb.ThirdParties.ListForOrganizationID(ctx, scope, input.OrganizationID, cursor, thirdPartyFilter)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -663,7 +663,7 @@ components:
|
|||||||
description: Organization ID
|
description: Organization ID
|
||||||
level:
|
level:
|
||||||
type: integer
|
type: integer
|
||||||
description: Filter by level
|
description: Filter by hierarchy depth (1 = direct third party, 2+ = third party of a third party / indirect). Defaults to 1 when omitted.
|
||||||
order_by:
|
order_by:
|
||||||
$ref: "#/components/schemas/ThirdPartyOrderBy"
|
$ref: "#/components/schemas/ThirdPartyOrderBy"
|
||||||
description: ThirdParty order by
|
description: ThirdParty order by
|
||||||
@@ -12606,7 +12606,7 @@ tools:
|
|||||||
$ref: "#/components/schemas/ListOrganizationsOutput"
|
$ref: "#/components/schemas/ListOrganizationsOutput"
|
||||||
- name: listThirdParties
|
- name: listThirdParties
|
||||||
title: List Third Parties
|
title: List Third Parties
|
||||||
description: List all thirdParties for the organization
|
description: List thirdParties for the organization. By default only direct third parties (level 1) are returned; pass level to filter by hierarchy depth.
|
||||||
hints:
|
hints:
|
||||||
readonly: true
|
readonly: true
|
||||||
destructive: false
|
destructive: false
|
||||||
|
|||||||
Reference in New Issue
Block a user