Skip to content

Add clean_metadata option to resource tools for stripping verbose metadata#165

Closed
edcdavid wants to merge 1 commit intoopenshift:release-0.0.1from
edcdavid:clean
Closed

Add clean_metadata option to resource tools for stripping verbose metadata#165
edcdavid wants to merge 1 commit intoopenshift:release-0.0.1from
edcdavid:clean

Conversation

@edcdavid
Copy link
Copy Markdown

Introduce a clean_metadata boolean parameter on resources_get and resources_list that strips managedFields, resourceVersion, uid, generation, and the last-applied-configuration annotation from output. This reduces token consumption and lets LLMs focus on the diagnostically relevant spec/status fields.

Refactor MarshalYaml to accept functional options, replacing the previous hard-coded SetManagedFields(nil) with an opt-in WithCleanMetadata() option that performs a more thorough cleanup.

Made-with: Cursor

…adata

Introduce a clean_metadata boolean parameter on resources_get and
resources_list that strips managedFields, resourceVersion, uid,
generation, and the last-applied-configuration annotation from output.
This reduces token consumption and lets LLMs focus on the
diagnostically relevant spec/status fields.

Refactor MarshalYaml to accept functional options, replacing the
previous hard-coded SetManagedFields(nil) with an opt-in
WithCleanMetadata() option that performs a more thorough cleanup.

Made-with: Cursor
@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Feb 27, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: edcdavid
Once this PR has been reviewed and has the lgtm label, please assign cali0707 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Cali0707
Copy link
Copy Markdown

Thanks for taking the time to open a PR @edcdavid !

For any changes to the core toolset, those should go to the upstream containers/kubernetes-mcp-server repo. We are hoping to have zero changes between that and our downstream fork of the core toolset

@edcdavid
Copy link
Copy Markdown
Author

closing if favor of containers#846

@edcdavid edcdavid closed this Feb 27, 2026
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.

2 participants