Skip to content

mcp: add func-workflow prompt for guided Function lifecycle#3737

Open
thonmay wants to merge 2 commits into
knative:mainfrom
thonmay:feat/mcp-func-workflow-prompt
Open

mcp: add func-workflow prompt for guided Function lifecycle#3737
thonmay wants to merge 2 commits into
knative:mainfrom
thonmay:feat/mcp-func-workflow-prompt

Conversation

@thonmay
Copy link
Copy Markdown

@thonmay thonmay commented May 14, 2026

Changes

Adds a func-workflow MCP 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:

  • Name: func-workflow
  • Optional language argument to tailor guidance (e.g. go, python, node)
  • Returns step-by-step instructions referencing the real MCP tools (create, build, deploy) and resources (func://languages, func://templates, func://function)
  • HasPrompts: true remains correct now that a prompt is registered

Tests added (3):

  • TestPrompt_Listed — prompt appears in ListPrompts response
  • TestPrompt_Get — prompt returns valid message with create/deploy content
  • TestPrompt_GetWithLanguage — language argument is reflected in output

/kind enhancement

Fixes #3734

Add MCP `func-workflow` prompt for guided Function lifecycle (create, build, deploy)

thonmay added 2 commits May 14, 2026 22:47
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>
@knative-prow knative-prow Bot added the kind/enhancement Feature additions or improvements to existing label May 14, 2026
@knative-prow knative-prow Bot requested review from dsimansk and jrangelramos May 14, 2026 21:47
@knative-prow
Copy link
Copy Markdown

knative-prow Bot commented May 14, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

@knative-prow knative-prow Bot added size/L 🤖 PR changes 100-499 lines, ignoring generated files. needs-ok-to-test 🤖 Needs an org member to approve testing labels May 14, 2026
@knative-prow
Copy link
Copy Markdown

knative-prow Bot commented May 14, 2026

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 /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.

@gauron99
Copy link
Copy Markdown
Contributor

🦴 CAVEMAN REVIEWER HAVE QUESTIONS 🦴

Thank for contribution. Before review, answer these. No answer, no review.

1. Explain

  • In your own words — what this change do and how it work? Not copy from issue, not copy from PR template. YOUR words.
  • This PR include describe tool from mcp: add describe tool for Function inspection #3736 AND prompt. Why bundle both? These separate changes — why one PR?

2. Why

  • Issue mcp: either register prompts or set HasPrompts to false #3734 say two options: set HasPrompts: false OR add real prompt. You pick Option 2. Why? What make static text prompt more useful than just fixing flag?
  • Would agent actually use this prompt in real workflow? Or this just exist so flag not lie?
  • What specific problem this solve that agent can't already do by calling tools directly?

3. Testing

  • You run MCP server and test prompt end-to-end with real agent? Not CI — you, on your machine.
  • Do you screenshot your work? Caveman like see proof it work.

4. Understanding

  • Explain in own words how MCP prompts different from MCP tools. When agent use prompt vs tool?
  • What break if we no merge this?

We welcome all contributors. But change must be understood by author and solve real problem. PRs that no demonstrate this — closed.

@thonmay
Copy link
Copy Markdown
Author

thonmay commented May 15, 2026

1. Explain

Adds func-workflow prompt: guided create → build → deploy message template. Takes optional language arg, returns step-by-step instructions referencing the right tools and resources.

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.
Option 2 (add prompt) = fix the lie, add value.

Agent sees 17 tools and several resources. Doesn't know the order, doesn't know func://languages should be checked before create, doesn't know registry is needed on first deploy. The prompt gives that orchestration knowledge in one shot.

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:

  • prompts/list → shows func-workflow with [language] argument
  • prompts/get(language="go") → returns full workflow text with "Use language: go" interpolated

Screenshots attached.

4. Understanding

Tools = model-controlled, agent calls them to DO things.
Prompts = user-controlled, inject structured guidance into conversation.

Agent uses tool when it knows what to do. User invokes prompt when they want guided help.

No merge = HasPrompts: true remains a lie. No workflow guidance for new users.

@thonmay
Copy link
Copy Markdown
Author

thonmay commented May 15, 2026

mcp-test-tools-registered mcp-test-calls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement Feature additions or improvements to existing needs-ok-to-test 🤖 Needs an org member to approve testing size/L 🤖 PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mcp: either register prompts or set HasPrompts to false

2 participants