demo_progress
Monitor task progress with 5 real-time updates, enabling clear status tracking in MCP workflows for enhanced transparency and efficiency.
Instructions
Demonstrate progress notifications with 5 updates
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server.ts:588-618 (handler)The handler function for 'demo_progress' that demonstrates progress notifications. It sends 5 progress updates (20%, 40%, 60%, 80%, 100%) using sendNotification and returns a structured completion response.async (_, { sendNotification }) => { log.info('Executing demo_progress'); requestCount++; const progressId = 'demo-progress-task'; for (let i = 1; i <= 5; i++) { await new Promise((resolve) => setTimeout(resolve, 500)); await sendNotification({ method: 'notifications/progress', params: { progressToken: progressId, progress: i * 20, message: `Step ${i} of 5 - Processing complex calculations...`, }, }); } return { content: [ { type: 'text', text: 'Progress demonstration completed', }, ], structuredContent: { message: 'Progress demonstration completed', progressSteps: [20, 40, 60, 80, 100], }, }; },
- src/server.ts:575-578 (schema)Output schema definition for the demo_progress tool, specifying message (string) and progressSteps (array of numbers).const demoProgressOutputSchema = { message: z.string(), progressSteps: z.array(z.number()), };
- src/server.ts:580-619 (registration)Registration of the 'demo_progress' tool using server.registerTool, including metadata, schemas, and inline handler function.server.registerTool( 'demo_progress', { title: 'Demo Progress', description: 'Demonstrate progress notifications with 5 updates', inputSchema: {}, outputSchema: demoProgressOutputSchema, }, async (_, { sendNotification }) => { log.info('Executing demo_progress'); requestCount++; const progressId = 'demo-progress-task'; for (let i = 1; i <= 5; i++) { await new Promise((resolve) => setTimeout(resolve, 500)); await sendNotification({ method: 'notifications/progress', params: { progressToken: progressId, progress: i * 20, message: `Step ${i} of 5 - Processing complex calculations...`, }, }); } return { content: [ { type: 'text', text: 'Progress demonstration completed', }, ], structuredContent: { message: 'Progress demonstration completed', progressSteps: [20, 40, 60, 80, 100], }, }; }, );