mcp: add func-workflow prompt for guided Function lifecycle#3737
mcp: add func-workflow prompt for guided Function lifecycle#3737thonmay wants to merge 2 commits into
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>
Adds a 'func-workflow' MCP prompt that guides agents through the full Function lifecycle: create, build, and deploy. Accepts an optional 'language' argument to tailor the guidance. This resolves the HasPrompts: true capability flag being advertised without any prompts registered, which could mislead MCP clients. Fixes knative#3734 Signed-off-by: Thonmay <mdthoriqulislam384@gmail.com>
|
[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 |
|
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. |
|
🦴 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 Adds Also includes describe tool from #3736. You're right, separate changes. I'll rebase this to prompt-only, keep describe in #3736. 2. Why Option 1 (set flag false) = fix the lie, add no value. Agent sees 17 tools and several resources. Doesn't know the order, doesn't know MCP clients (Claude Desktop, Cursor) expose prompts to users. User picks "func-workflow" → agent gets a structured plan. Tools are individual actions; prompt is the recipe. Without it, agent relies on instructions.md (long, may get truncated in some clients). 3. Testing Ran locally:
Screenshots attached. 4. Understanding Tools = model-controlled, agent calls them to DO things. Agent uses tool when it knows what to do. User invokes prompt when they want guided help. No merge = |


Changes
Adds a
func-workflowMCP prompt that guides agents through the full Function lifecycle: create, build, and deploy.Why Option 2 (add a real prompt) over Option 1 (set HasPrompts: false):
Setting the flag to false would be a minimal fix but leaves the capability unused. A guided workflow prompt is directly useful to agents and aligns with the MCP server's purpose of enabling end-to-end agentic usage of Functions.
Prompt behavior:
func-workflowlanguageargument to tailor guidance (e.g. go, python, node)HasPrompts: trueremains correct now that a prompt is registeredTests added (3):
TestPrompt_Listed— prompt appears in ListPrompts responseTestPrompt_Get— prompt returns valid message with create/deploy contentTestPrompt_GetWithLanguage— language argument is reflected in output/kind enhancement
Fixes #3734