Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 Automated fix attempt
Fixes #571
Source issue: #571
Summary
Summary
Changes made to
mcp/src/tools/functions.ts:Updated
handlerdescription inCREATE_FUNCTION_SCHEMA(line ~270-277): The handler field description now explicitly distinguishes between Event and HTTP functions. It tells agents that Event functions usefile.exportformat (e.g.,index.main), while HTTP functions do not need a handler because entry is determined byscf_bootstrap. Setting handler for HTTP functions can cause startup conflicts.Updated
handlerdescription in the manage function input schema (the outerhandlerparameter): Same explicit guidance — Event functions usefile.exportformat; HTTP functions don't need handler and should not set it.Added fail-fast validation (line ~906-913): When
func.type === "HTTP"andfunc.handlercontains a dot (i.e., Event-stylefile.exportformat likeindex.main), the tool now throws an error immediately before the deployment proceeds. The error message explains that HTTP functions usescf_bootstrapto listen on a port, don't need afile.exporthandler, and the agent should remove thefunc.handlerfield and ensure the function directory containsscf_bootstrapand a port-listening entry script.Changes made to
mcp/src/tools/functions.test.ts:Added three regression tests:
handler: "index.main"returnssuccess: false, includes the handler value andscf_bootstrapin the error message, and never callscreateFunction.handler: "index.main"still work (no regression).