Skip to content

mcp: migrate healthcheck tool to call pkg/functions directly#3788

Open
vishal-iiserb wants to merge 1 commit into
knative:mainfrom
vishal-iiserb:mcp-healthcheck-direct-api
Open

mcp: migrate healthcheck tool to call pkg/functions directly#3788
vishal-iiserb wants to merge 1 commit into
knative:mainfrom
vishal-iiserb:mcp-healthcheck-direct-api

Conversation

@vishal-iiserb
Copy link
Copy Markdown

Part of the phased migration in #3771.
Next candidate: describe.

What changed###

  • tools_healthcheck.go: handler now calls s.client.List(ctx, "") via
    pkg/functions directly to verify cluster connectivity, replacing the
    server-only liveness check.
  • mcp.go: added client *fn.Client field to Server, initialized in
    New(), and added WithClient option for test injection.
  • tools_healthcheck_test.go: new tests for cluster-reachable,
    cluster-unreachable, and output schema shape — no subprocess involved.

Why###

The previous healthcheck only confirmed the MCP process was alive. Agents
had no way to know if the underlying cluster was reachable before calling
other tools. This change surfaces that information as a typed field.

Tests###

go test ./pkg/mcp/... -v — all pass including 4 new healthcheck tests.

Fixes: part of #3771

@knative-prow
Copy link
Copy Markdown

knative-prow Bot commented May 19, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: vishal-iiserb
Once this PR has been reviewed and has the lgtm label, please assign gauron99 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

@linux-foundation-easycla
Copy link
Copy Markdown

CLA Not Signed

@knative-prow knative-prow Bot requested review from dsimansk and jrangelramos May 19, 2026 07:51
@knative-prow
Copy link
Copy Markdown

knative-prow Bot commented May 19, 2026

Welcome @vishal-iiserb! It looks like this is your first PR to knative/func 🎉

@knative-prow knative-prow Bot added the size/XL 🤖 PR changes 500-999 lines, ignoring generated files. label May 19, 2026
@knative-prow
Copy link
Copy Markdown

knative-prow Bot commented May 19, 2026

Hi @vishal-iiserb. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@knative-prow knative-prow Bot added the needs-ok-to-test 🤖 Needs an org member to approve testing label May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ok-to-test 🤖 Needs an org member to approve testing size/XL 🤖 PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants