improve: add depth param#68
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds an optional depth parameter to CloudAPI v6 MCP tools (Compute + Managed Kubernetes) so callers can control the nesting depth of returned objects, and updates routing tests/docs to reflect the new query parameter behavior.
Changes:
- Added
Depth *int32to relevant tool input structs (and introduced newList*Inputtypes for list tools that previously usedstruct{}). - Updated Compute + K8s tool handlers to pass
depththrough to the SDK request builders (defaulting list operations todepth=1). - Updated endpoint routing tests to assert
depth=1is sent for list operations; updated multiple docs pages (with some remaining gaps noted in PR comments).
Reviewed changes
Copilot reviewed 50 out of 50 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/k8s/nodepool.go | Adds depth support to list/get nodepool calls. |
| tools/k8s/node.go | Adds depth support to list/get node calls. |
| tools/k8s/cluster.go | Adds depth support to list/get cluster calls (list defaults to 1). |
| tools/inputs.go | Extends input schemas with optional depth and introduces new List*Input structs. |
| tools/compute/volume.go | Adds depth support to list/get volume calls (list defaults to 1). |
| tools/compute/template.go | Adds depth support to list/get template calls (list defaults to 1). |
| tools/compute/target_group.go | Adds depth support to list/get target group calls (list defaults to 1). |
| tools/compute/snapshot.go | Adds depth support to list/get snapshot calls (list defaults to 1). |
| tools/compute/server.go | Adds depth support to server + server-subresource tools (lists default to 1). |
| tools/compute/security_group.go | Adds depth support to security group + rules tools (lists default to 1). |
| tools/compute/request.go | Adds depth support to request tools (list defaults to 1). |
| tools/compute/private_cross_connect.go | Adds depth support to PCC tools (list defaults to 1). |
| tools/compute/nic.go | Adds depth support to NIC tools (list defaults to 1). |
| tools/compute/network_loadbalancer.go | Adds depth support to NLB + forwarding rules tools (lists default to 1). |
| tools/compute/nat_gateway.go | Adds depth support to NAT gateway + rules tools (lists default to 1). |
| tools/compute/location.go | Adds depth support to location listing (defaults to 1). |
| tools/compute/loadbalancer.go | Adds depth support to LB + balanced NICs tools (lists default to 1). |
| tools/compute/lan.go | Adds depth support to LAN + LAN NICs tools (lists default to 1). |
| tools/compute/ip_block.go | Adds depth support to IP block tools (list defaults to 1). |
| tools/compute/image.go | Adds depth support to image listing (defaults to 1). |
| tools/compute/firewall_rule.go | Adds depth support to firewall rule tools (list defaults to 1). |
| tools/compute/datacenter.go | Adds depth support to datacenter tools (list defaults to 1) and updates tool description. |
| tools/compute/contract.go | Adds optional depth support to get_contract. |
| tools/compute/application_loadbalancer.go | Adds depth support to ALB + forwarding rules tools (lists default to 1). |
| test/k8s_test.go | Asserts depth=1 query param for affected K8s list tools. |
| test/compute_test.go | Asserts depth=1 query param for affected Compute list tools. |
| docs/k8s/nodepool.md | Documents depth for list_k8s_nodepools. |
| docs/k8s/node.md | Documents depth for node list/get tools. |
| docs/k8s/cluster.md | Documents depth for list_k8s_clusters. |
| docs/compute/volume.md | Documents depth for volume list/get tools. |
| docs/compute/template.md | Documents depth for get_template. |
| docs/compute/target-group.md | Documents depth for get_target_group. |
| docs/compute/snapshot.md | Documents depth for snapshot list/get tools. |
| docs/compute/server.md | Documents depth for list_servers. |
| docs/compute/server-subresources.md | Documents depth for get_server_gpu and get_server_remote_console. |
| docs/compute/security-group.md | Documents depth for list_security_groups and get_security_group_rule. |
| docs/compute/request.md | Documents depth for get_request and get_request_status. |
| docs/compute/private-cross-connect.md | Documents depth for get_private_cross_connect. |
| docs/compute/nic.md | Documents depth for list_nics. |
| docs/compute/network-loadbalancer.md | Documents depth for list_network_loadbalancers. |
| docs/compute/nat-gateway.md | Documents depth for list_nat_gateways. |
| docs/compute/location.md | Documents depth for list_locations. |
| docs/compute/loadbalancer.md | Documents depth for list_loadbalancers. |
| docs/compute/lan.md | Documents depth for list_lans. |
| docs/compute/ip-block.md | Documents depth for get_ip_block. |
| docs/compute/image.md | Documents depth for list_images. |
| docs/compute/firewall-rule.md | Documents depth for firewall rule list/get tools. |
| docs/compute/datacenter.md | Documents depth for list_datacenters. |
| docs/compute/contract.md | Documents depth for get_contract. |
| docs/compute/application-loadbalancer.md | Documents depth for list_application_loadbalancers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
avirtopeanu-ionos
approved these changes
Jun 17, 2026
avirtopeanu-ionos
left a comment
Contributor
There was a problem hiding this comment.
Nice work, can you also add to the CHANGELOG.md ?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
depthoptional parameter to cloudapi-v6 tools (compute and k8s)