message_complete_notification
Signal completion of tasks or responses by sending cross-platform notifications to users. Use this tool once per message to indicate when work is finished.
Instructions
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectName | Yes | Notification title | |
| message | Yes | Notification body |
Implementation Reference
- src/index.ts:162-174 (handler)The handler function for the 'message_complete_notification' tool. It extracts projectName and message from input args, sends a desktop notification using node-notifier, and returns a confirmation message.(args) => { // Use inferred args type const { projectName, message } = args; notifier.notify({ title: projectName, message }); return { content: [ { type: 'text', text: 'Notification sent. You can now wait for user input.', }, ], }; },
- src/index.ts:153-176 (registration)The registration of the tool handler using server.tool(), conditionally based on tool enablement. Includes dynamic description resolution and schema from the tool definition.if (isToolEnabled('message_complete_notification')) { // Use properties from the imported tool object server.tool( 'message_complete_notification', // Description is a string here, but handle consistently typeof messageCompleteNotificationTool.description === 'function' ? messageCompleteNotificationTool.description(globalTimeoutSeconds) // Should not happen based on definition, but safe : messageCompleteNotificationTool.description, messageCompleteNotificationTool.schema, // Use schema property (args) => { // Use inferred args type const { projectName, message } = args; notifier.notify({ title: projectName, message }); return { content: [ { type: 'text', text: 'Notification sent. You can now wait for user input.', }, ], }; }, ); }
- Zod schema (raw shape) defining the input parameters: projectName and message, used for validation in the tool registration.const rawSchema: ZodRawShape = { projectName: z.string().describe('Notification title'), message: z.string().describe('Notification body'), };
- JSON Schema in ToolCapabilityInfo defining the tool's parameters and description for MCP protocol capability declaration.const capabilityInfo: ToolCapabilityInfo = { description: 'Notify when a response has completed via OS notification.', parameters: { type: 'object', properties: { projectName: { type: 'string', description: 'Identifies the context/project making the notification (appears in notification title)', }, message: { type: 'string', description: 'The specific notification text (appears in the body)', }, }, required: ['projectName', 'message'], }, };
- src/tool-definitions/message-complete-notification.ts:72-76 (registration)Export of the ToolDefinition object combining capability, description, and schema, imported and used in index.ts for registration.export const messageCompleteNotificationTool: ToolDefinition = { capability: capabilityInfo, description: registrationDescription, schema: rawSchema, // Use the raw shape here };