@@ -971,17 +971,19 @@ resource apiMcpExistingServer 'Microsoft.ApiManagement/service/apis@2025-09-01-p
971971 })
972972}
973973
974- // 8b. Policy-based MCP server exposing DummyJSON todo tools
974+ // 8b. MCP server exposing the DummyJSON todo operations of src-rest-openapi
975975// Kept on its own API (separate from the Petstore tools on src-mcp-from-api) so
976- // the two tool sets are isolated. The MCP behaviour is implemented entirely in
977- // the api-level policy (mcpTodosPolicyXml in source-apim-post-activation.bicep),
978- // so no mcpTools or backend are required here.
976+ // the two tool sets are isolated. An MCP API must set exactly one of mcpTools or
977+ // backendId; here the todo operations of src-rest-openapi are surfaced as tools.
978+ // The api-level policy (mcpTodosPolicyXml in source-apim-post-activation.bicep)
979+ // implements the JSON-RPC behaviour against DummyJSON.
979980resource apiMcpTodos 'Microsoft.ApiManagement/service/apis@2025-09-01-preview' = {
980981 parent : apim
981982 name : 'src-mcp-todos'
983+ dependsOn : [apiRestOpenapi ]
982984 properties : any ({
983985 displayName : 'KS MCP Todos Server'
984- description : 'Policy-based MCP server exposing DummyJSON todo tools (listItems, getItem, createItem, healthCheck)'
986+ description : 'MCP server exposing DummyJSON todo tools (listItems, getItem, createItem, healthCheck)'
985987 path : 'ks/mcp-todos'
986988 protocols : ['https' ]
987989 subscriptionRequired : false
@@ -993,6 +995,28 @@ resource apiMcpTodos 'Microsoft.ApiManagement/service/apis@2025-09-01-preview' =
993995 }
994996 }
995997 }
998+ mcpTools : [
999+ {
1000+ name : 'listItems'
1001+ description : 'List todo items'
1002+ operationId : resourceId ('Microsoft.ApiManagement/service/apis/operations' , apimName , 'src-rest-openapi' , 'listItems' )
1003+ }
1004+ {
1005+ name : 'getItem'
1006+ description : 'Get a todo item by id'
1007+ operationId : resourceId ('Microsoft.ApiManagement/service/apis/operations' , apimName , 'src-rest-openapi' , 'getItem' )
1008+ }
1009+ {
1010+ name : 'createItem'
1011+ description : 'Create a todo item'
1012+ operationId : resourceId ('Microsoft.ApiManagement/service/apis/operations' , apimName , 'src-rest-openapi' , 'createItem' )
1013+ }
1014+ {
1015+ name : 'healthCheck'
1016+ description : 'Return APIM MCP server health'
1017+ operationId : resourceId ('Microsoft.ApiManagement/service/apis/operations' , apimName , 'src-rest-openapi' , 'healthCheck' )
1018+ }
1019+ ]
9961020 })
9971021}
9981022
0 commit comments