mcp: add describe tool for Function inspection#3736
Conversation
Adds a new MCP tool 'describe' that exposes the 'func describe' command to agents. The tool accepts an optional name (positional) or --path flag (mutually exclusive), plus --namespace, --output, and --verbose flags. When neither path nor name is provided, the function in the current working directory is described. Fixes knative#3729 Signed-off-by: Thonmay <mdthoriqulislam384@gmail.com>
|
@thonmay: The label(s) DetailsIn response to this:
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. |
|
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: thonmay The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @thonmay! It looks like this is your first PR to knative/func 🎉 |
|
Hi @thonmay. 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 Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
/kind enhancement |
|
🦴 CAVEMAN REVIEWER HAVE QUESTIONS 🦴 Thank for contribution. Before review, answer these. No answer, no review. 1. Explain
2. Why
3. Testing
4. Understanding
We welcome all contributors. But change must be understood by author and solve real problem. PRs that no demonstrate this — closed. |
|
1. Explain Wraps Same pattern as every other tool in the package. Nothing fancy. 2. Why Agent deploys a Function. Wants to check: is the route serving? What revision is active? What image is running?
Neither tells you revisions, conditions, subscriptions, or image digest for a specific Function. Without
3. Testing Built binary, ran MCP server, sent JSON-RPC over stdio:
Screenshots attached. No cluster available for full e2e, but the chain works end-to-end up to the cluster boundary. 4. Understanding
No merge = agents can deploy but can't inspect. Gap in the lifecycle. |


Changes
Adds a new MCP tool
describethat exposes thefunc describecommand to agents, completing the core Function lifecycle toolset alongside create, build, deploy, list, and delete.Tool behavior:
name(positional arg) or--pathflag — mutually exclusive--namespace,--output, and--verboseflagsReadOnlyHint: true,IdempotentHint: true, no readonly guard neededTests added (5):
TestTool_Describe_Args— name-based lookup with all flagsTestTool_Describe_PathBased— path-based lookupTestTool_Describe_MutualExclusion— both path and name provided returns errorTestTool_Describe_NeitherProvided— no args describes function in cwdTestTool_Describe_BinaryFailure— executor error propagated correctly/kind enhancement
Fixes #3729