Skip to content

Conversation

@JAORMX
Copy link
Collaborator

@JAORMX JAORMX commented Sep 8, 2025

Description

This PR adds the missing pagination parameters (limit and continue) to the MCP tool schema definition for the list_resources tool.

Problem

The pagination functionality was already implemented in the backend (in pkg/k8s/client.go and pkg/mcp/list_resources.go), but the MCP tool schema definition in pkg/mcp/tools.go was missing the parameter declarations. This meant that:

  • The parameters weren't visible in the tool's schema
  • MCP clients couldn't see or use these parameters properly
  • The tool documentation was incomplete

Solution

Added the missing parameter definitions to the NewListResourcesTool() function:

  • limit (number): Maximum number of resources to return (0 means no limit, default: 0)
  • continue (string): Continue token for pagination (use the value from previous response's ListMeta.Continue)

Changes

  • Added mcp.WithNumber("limit", ...) parameter definition
  • Added mcp.WithString("continue", ...) parameter definition

Testing

The pagination functionality itself was already tested in the previous PR. This change only updates the schema definition to match the existing implementation.

Impact

This is a non-breaking change that:

  • ✅ Makes the pagination parameters visible in the tool schema
  • ✅ Improves tool documentation and discoverability
  • ✅ Allows MCP clients to properly use pagination
  • ✅ Maintains backward compatibility

The limit and continue parameters were missing from the MCP tool schema
definition, even though they were already implemented in the backend.
This fix adds the missing parameter definitions to ensure the tool
schema matches the actual implementation.
@JAORMX JAORMX merged commit 3233f7a into main Sep 8, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants