demo_progress
Demonstrates progress notifications with five sequential updates to show task completion status.
Instructions
Demonstrate progress notifications with 5 updates
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server.ts:575-578 (schema)Output schema definition for the demo_progress tool, defining structured output with message and progressSteps array using Zod validation.const demoProgressOutputSchema = { message: z.string(), progressSteps: z.array(z.number()), };
- src/server.ts:580-587 (registration)Registration of the demo_progress tool with server.registerTool, including empty input schema and reference to output schema.server.registerTool( 'demo_progress', { title: 'Demo Progress', description: 'Demonstrate progress notifications with 5 updates', inputSchema: {}, outputSchema: demoProgressOutputSchema, },
- src/server.ts:588-619 (handler)Handler function for demo_progress tool that simulates progress by sending 5 notifications with increasing progress (20%,40%,etc.) using sendNotification, then returns completion message with structured content.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], }, }; }, );