-
Couldn't load subscription status.
- Fork 465
Adding MCP Tool Trigger Template #4651
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -614,5 +614,47 @@ | |
| "enabledInTryMode": false, | ||
| "userPrompt": [] | ||
| } | ||
| }, | ||
| { | ||
| "id": "McpToolTrigger-Typescript-4.x", | ||
| "runtime": "2", | ||
| "files": { | ||
| "%functionName%.ts": "import { app, InvocationContext, output } from \"@azure/functions\";\n\nconst PROPERTY_TYPE = \"string\";\n\n// Hello function - responds with hello message\nexport async function mcpToolHello(_toolArguments:unknown, context: InvocationContext): Promise<string> {\n // Get name from the tool arguments\n const mcptoolargs = context.triggerMetadata.mcptoolargs as {\n name?: string;\n };\n const name = mcptoolargs?.name;\n\n console.info(`Hello ${name}, I am MCP Tool!`);\n\n return `Hello ${name}, I am MCP Tool!`;\n}\n\n// Register the hello tool\napp.mcpTool('hello', {\n toolName: 'hello',\n description: 'Simple hello world MCP Tool that responses with a hello message.',\n toolProperties:[\n {\n propertyName: \"name\",\n propertyType: PROPERTY_TYPE,\n description: \"Required property to identify the caller.\",\n isRequired: true,\n }],\n handler: mcpToolHello\n});" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Template seems to be OK, but it looks like we're still pulling the old ext bundle as it does not find the binding - is the new ext bundle with mcp fully released? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not yet, but it is in flight. We will have the bundle release early next week. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree with Naren that we should not merge until bundles is fully out. I can provide approval next week after validating with bundles releases |
||
| }, | ||
| "metadata": { | ||
| "defaultFunctionName": "mcpToolTrigger", | ||
| "description": "$McpToolTrigger_description", | ||
| "name": "Mcp Tool Trigger", | ||
liliankasem marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "language": "TypeScript", | ||
| "triggerType": "mcpToolTrigger", | ||
| "category": [ | ||
| "$temp_category_core", | ||
| "$temp_category_dataProcessing" | ||
| ], | ||
| "categoryStyle": "other", | ||
| "enabledInTryMode": false, | ||
| "userPrompt": [] | ||
| } | ||
| }, | ||
| { | ||
| "id": "McpToolTrigger-Javascript-4.x", | ||
| "runtime": "2", | ||
| "files": { | ||
| "%functionName%.js": "import { app } from \"@azure/functions\";\n\nconst PROPERTY_TYPE = \"string\";\n\n// Hello function - responds with hello message\nexport async function mcpToolHello(_toolArguments, context) {\n // Get name from the tool arguments\n const mcptoolargs = context.triggerMetadata.mcptoolargs || {};\n const name = mcptoolargs.name;\n\n console.info(`Hello ${name}, I am MCP Tool!`);\n\n return `Hello ${name}, I am MCP Tool!`;\n}\n\n// Register the hello tool\napp.mcpTool('hello', {\n toolName: 'hello',\n description: 'Simple hello world MCP Tool that responses with a hello message.',\n toolProperties: [\n {\n propertyName: \"name\",\n propertyType: PROPERTY_TYPE,\n description: \"Required property to identify the caller.\",\n isRequired: true,\n }\n ],\n handler: mcpToolHello\n});" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got an error with this template: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried with the steps and those steps worked for me. Lets connect offline to resolve this.
// cd into ./_testapp
|
||
| }, | ||
| "metadata": { | ||
| "defaultFunctionName": "mcpToolTrigger", | ||
| "description": "$McpToolTrigger_description", | ||
| "name": "Mcp Tool Trigger", | ||
liliankasem marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "language": "JavaScript", | ||
| "triggerType": "mcpToolTrigger", | ||
| "category": [ | ||
| "$temp_category_core", | ||
| "$temp_category_dataProcessing" | ||
| ], | ||
| "categoryStyle": "other", | ||
| "enabledInTryMode": false, | ||
| "userPrompt": [] | ||
| } | ||
| } | ||
| ] | ||
Uh oh!
There was an error while loading. Please reload this page.