Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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], }, }; },
  • 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], }, }; }, );

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yigitkonur/example-mcp-server-stdio'

If you have feedback or need assistance with the MCP directory API, please join our Discord server