Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
#### Changes

- Add updated Durable .NET templates (#4692)
- Adding the MCP Tool Trigger Templates for the Node/Typescript (#4651)
- Set `AzureWebJobsStorage` to use the storage emulator by default on all platforms (#4685)
4 changes: 2 additions & 2 deletions src/Cli/func/Common/TemplatesManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using System.Reflection;
Expand Down Expand Up @@ -134,7 +134,7 @@ private static async Task<IEnumerable<Template>> GetNodeV4TemplatesJson()

public async Task Deploy(string name, string fileName, Template template)
{
if (template.Id.EndsWith("JavaScript-4.x") || template.Id.EndsWith("TypeScript-4.x"))
if (template.Id.EndsWith("JavaScript-4.x", StringComparison.OrdinalIgnoreCase) || template.Id.EndsWith("TypeScript-4.x", StringComparison.OrdinalIgnoreCase))
{
await DeployNewNodeProgrammingModel(name, fileName, template);
}
Expand Down
44 changes: 43 additions & 1 deletion src/Cli/func/StaticResources/node-v4-templates.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[
[
{
"id": "BlobTrigger-JavaScript-4.x",
"runtime": "2",
Expand Down Expand Up @@ -614,5 +614,47 @@
"enabledInTryMode": false,
"userPrompt": []
}
},
{
"id": "McpToolTrigger-Typescript-4.x",
"runtime": "2",
"files": {
"%functionName%.ts": "import { app, InvocationContext, arg } from \"@azure/functions\";\n\nexport async function mcpToolHello(_toolArguments: any, context: InvocationContext): Promise<string> {\n const mcptoolargs = _toolArguments.arguments 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\napp.mcpTool('hello', {\n toolName: 'hello',\n description: 'Simple hello world MCP Tool that responses with a hello message.',\n toolProperties: {\n name: arg.string().describe('Name to greet'),\n },\n handler: mcpToolHello\n});"
},
"metadata": {
"defaultFunctionName": "mcpToolTrigger",
"description": "$McpToolTrigger_description",
"name": "MCP Tool Trigger",
"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": "const { app, arg } = require('@azure/functions');\n\nfunction mcpToolHello(_toolArguments, context) {\n const mcptoolargs = context.triggerMetadata.mcptoolargs || {};\n const name = mcptoolargs.name;\n console.info(`Hello ${name}, I am MCP Tool!`);\n return `Hello ${name}, I am MCP Tool!`;\n}\n\napp.mcpTool('hello', {\n toolName: 'hello',\n description: 'Simple hello world MCP Tool that responses with a hello message.',\n toolProperties:{\n name: arg.string().describe('Name to greet'),\n },\n handler: mcpToolHello\n});"
},
"metadata": {
"defaultFunctionName": "mcpToolTrigger",
"description": "$McpToolTrigger_description",
"name": "MCP Tool Trigger",
"language": "JavaScript",
"triggerType": "mcpToolTrigger",
"category": [
"$temp_category_core",
"$temp_category_dataProcessing"
],
"categoryStyle": "other",
"enabledInTryMode": false,
"userPrompt": []
}
}
]
Loading