diff --git a/src/Microsoft.Agents.A365.DevTools.MockToolingServer/README.md b/src/Microsoft.Agents.A365.DevTools.MockToolingServer/README.md index 16d968e1..059062e7 100644 --- a/src/Microsoft.Agents.A365.DevTools.MockToolingServer/README.md +++ b/src/Microsoft.Agents.A365.DevTools.MockToolingServer/README.md @@ -1,3 +1,39 @@ +# Mock Tooling Server + +A lightweight MCP (Model Context Protocol) server that provides mock implementations of common Microsoft Graph and M365 tools for local agent development and testing. + +## Available Mock Servers + +The following mock server definitions are included out of the box: + +| Server | File | Description | +|--------|------|-------------| +| `mcp_CalendarTools` | `mocks/mcp_CalendarTools.json` | Calendar operations (createEvent, listEvents, getSchedule, findMeetingTimes, etc.) | +| `mcp_MailTools` | `mocks/mcp_MailTools.json` | Email operations (SendEmail, SendEmailWithAttachments, etc.) | +| `mcp_MeServer` | `mocks/mcp_MeServer.json` | User/directory operations (listUsers, getMyProfile, getManager, etc.) | + +### mcp_MeServer Tools + +Tools for user profile and directory search operations: + +| Tool | Description | +|------|-------------| +| `getMyProfile` | Get the currently signed-in user's profile (displayName, mail, jobTitle, etc.) | +| `listUsers` | Search for users in the directory by name or email. Essential for finding email addresses when only a name is provided. | +| `getUser` | Get a specific user's profile by ID or userPrincipalName | +| `getManager` | Get a user's manager | +| `getDirectReports` | Get a user's direct reports | + +### mcp_CalendarTools Tools + +Tools for calendar and scheduling operations including `createEvent`, `listEvents`, `getSchedule`, `findMeetingTimes`, `updateEvent`, `deleteEvent`, `cancelEvent`, `acceptEvent`, `declineEvent`, and more. + +### mcp_MailTools Tools + +Tools for email operations including `SendEmail`, `SendEmailWithAttachments`, and related mail functionality. + +--- + # How to mock notifications for custom activities ## Prerequisites diff --git a/src/Microsoft.Agents.A365.DevTools.MockToolingServer/mocks/mcp_CalendarTools.json b/src/Microsoft.Agents.A365.DevTools.MockToolingServer/mocks/mcp_CalendarTools.json index 8f8bff27..8794eda6 100644 --- a/src/Microsoft.Agents.A365.DevTools.MockToolingServer/mocks/mcp_CalendarTools.json +++ b/src/Microsoft.Agents.A365.DevTools.MockToolingServer/mocks/mcp_CalendarTools.json @@ -779,7 +779,7 @@ "endDateTime" ] }, - "responseTemplate": "Calendar view retrieved from {{startDateTime}} to {{endDateTime}} (mock).", + "responseTemplate": "{\"value\": [{\"id\": \"mock-event-001\", \"subject\": \"Team Sync\", \"start\": {\"dateTime\": \"2026-02-01T10:00:00\"}, \"end\": {\"dateTime\": \"2026-02-01T10:30:00\"}, \"showAs\": \"busy\"}, {\"id\": \"mock-event-002\", \"subject\": \"Product Roadmap Review\", \"start\": {\"dateTime\": \"2026-02-01T14:00:00\"}, \"end\": {\"dateTime\": \"2026-02-01T15:00:00\"}, \"showAs\": \"busy\"}, {\"id\": \"mock-event-003\", \"subject\": \"Board Presentation\", \"start\": {\"dateTime\": \"2026-02-01T10:00:00\"}, \"end\": {\"dateTime\": \"2026-02-01T11:00:00\"}, \"showAs\": \"busy\"}]}", "delayMs": 250, "errorRate": 0, "statusCode": 200, @@ -829,7 +829,7 @@ } } }, - "responseTemplate": "Events list retrieved for user {{userId}} (mock).", + "responseTemplate": "{\"value\": [{\"id\": \"mock-event-001\", \"subject\": \"Team Sync\", \"start\": {\"dateTime\": \"2026-02-01T10:00:00\"}, \"end\": {\"dateTime\": \"2026-02-01T10:30:00\"}}, {\"id\": \"mock-event-002\", \"subject\": \"Product Roadmap Review\", \"start\": {\"dateTime\": \"2026-02-01T14:00:00\"}, \"end\": {\"dateTime\": \"2026-02-01T15:00:00\"}}, {\"id\": \"mock-event-003\", \"subject\": \"Board Presentation\", \"start\": {\"dateTime\": \"2026-02-01T10:00:00\"}, \"end\": {\"dateTime\": \"2026-02-01T11:00:00\"}}]}", "delayMs": 250, "errorRate": 0, "statusCode": 200, diff --git a/src/Microsoft.Agents.A365.DevTools.MockToolingServer/mocks/mcp_MeServer.json b/src/Microsoft.Agents.A365.DevTools.MockToolingServer/mocks/mcp_MeServer.json new file mode 100644 index 00000000..5080068f --- /dev/null +++ b/src/Microsoft.Agents.A365.DevTools.MockToolingServer/mocks/mcp_MeServer.json @@ -0,0 +1,122 @@ +[ + { + "name": "getMyProfile", + "description": "Get the profile of the currently signed-in user, including their display name, email address, job title, and other basic information.", + "inputSchema": { + "type": "object", + "properties": { + "select": { + "type": "string", + "description": "Comma-separated list of properties to return (e.g., 'displayName,mail,jobTitle'). If not specified, returns default properties." + } + }, + "required": [] + }, + "responseTemplate": "{\"id\": \"mock-user-001\", \"displayName\": \"Mock User\", \"mail\": \"mock.user@contoso.com\", \"userPrincipalName\": \"mock.user@contoso.com\", \"jobTitle\": \"Software Engineer\", \"officeLocation\": \"Building 1\", \"mobilePhone\": \"+1-555-0100\"}", + "delayMs": 100, + "errorRate": 0, + "statusCode": 200, + "enabled": true + }, + { + "name": "listUsers", + "description": "Search for users in the organization directory. Use this to find a person's email address when you only know their name. Supports filtering by displayName, mail, userPrincipalName, and other properties.", + "inputSchema": { + "type": "object", + "properties": { + "search": { + "type": "string", + "description": "Search string to find users. Use format like '\"displayName:John\"' to search by display name, or '\"mail:john@\"' to search by email. Supports partial matching." + }, + "filter": { + "type": "string", + "description": "OData filter expression (e.g., \"startsWith(displayName,'John')\" or \"mail eq 'john@contoso.com'\")." + }, + "select": { + "type": "string", + "description": "Comma-separated list of properties to return (e.g., 'displayName,mail,id')." + }, + "top": { + "type": "integer", + "description": "Maximum number of results to return. Default is 10, maximum is 999." + }, + "orderby": { + "type": "string", + "description": "Property to sort results by (e.g., 'displayName asc')." + } + }, + "required": [] + }, + "responseTemplate": "{\"@odata.context\": \"https://graph.microsoft.com/v1.0/$metadata#users\", \"value\": [{\"id\": \"mock-user-{{search}}\", \"displayName\": \"{{search}} (Mock User)\", \"mail\": \"{{search}}@contoso.com\", \"userPrincipalName\": \"{{search}}@contoso.com\", \"jobTitle\": \"Team Member\", \"officeLocation\": \"Remote\"}]}", + "delayMs": 150, + "errorRate": 0, + "statusCode": 200, + "enabled": true + }, + { + "name": "getUser", + "description": "Get the profile of a specific user by their ID or userPrincipalName.", + "inputSchema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "The unique identifier (GUID) or userPrincipalName (email) of the user to retrieve." + }, + "select": { + "type": "string", + "description": "Comma-separated list of properties to return." + } + }, + "required": ["userId"] + }, + "responseTemplate": "{\"id\": \"{{userId}}\", \"displayName\": \"{{userId}} (Mock User)\", \"mail\": \"{{userId}}\", \"userPrincipalName\": \"{{userId}}\", \"jobTitle\": \"Team Member\", \"officeLocation\": \"Building 1\"}", + "delayMs": 100, + "errorRate": 0, + "statusCode": 200, + "enabled": true + }, + { + "name": "getManager", + "description": "Get the manager of a specific user or the currently signed-in user.", + "inputSchema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "The unique identifier or userPrincipalName of the user. Use 'me' for the currently signed-in user." + } + }, + "required": [] + }, + "responseTemplate": "{\"@odata.context\": \"https://graph.microsoft.com/v1.0/$metadata#directoryObjects/$entity\", \"@odata.type\": \"#microsoft.graph.user\", \"id\": \"mock-manager-001\", \"displayName\": \"Mock Manager\", \"mail\": \"mock.manager@contoso.com\", \"userPrincipalName\": \"mock.manager@contoso.com\", \"jobTitle\": \"Engineering Manager\"}", + "delayMs": 100, + "errorRate": 0, + "statusCode": 200, + "enabled": true + }, + { + "name": "getDirectReports", + "description": "Get the direct reports of a specific user or the currently signed-in user.", + "inputSchema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "The unique identifier or userPrincipalName of the user. Use 'me' for the currently signed-in user." + }, + "top": { + "type": "integer", + "description": "Maximum number of results to return." + } + }, + "required": [] + }, + "responseTemplate": "{\"@odata.context\": \"https://graph.microsoft.com/v1.0/$metadata#directoryObjects\", \"value\": [{\"@odata.type\": \"#microsoft.graph.user\", \"id\": \"mock-report-001\", \"displayName\": \"Alice Johnson (Mock)\", \"mail\": \"alice.johnson@contoso.com\", \"jobTitle\": \"Software Engineer\"}, {\"@odata.type\": \"#microsoft.graph.user\", \"id\": \"mock-report-002\", \"displayName\": \"Bob Smith (Mock)\", \"mail\": \"bob.smith@contoso.com\", \"jobTitle\": \"Software Engineer\"}]}", + "delayMs": 100, + "errorRate": 0, + "statusCode": 200, + "enabled": true + } +] +