wait-seconds
Pause execution for a specified number of seconds in MetaMask MCP workflows, enabling timed delays for blockchain interactions or process synchronization.
Instructions
Wait the given seconds.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seconds | Yes |
Implementation Reference
- src/tools/wait-seconds.ts:11-22 (handler)Handler function that extracts seconds from args, waits the equivalent milliseconds using the wait helper, and returns a text content response indicating the wait completed.execute: async (args) => { const seconds = args.seconds; await wait(seconds * 1000); return { content: [ { type: "text", text: `Wait for ${seconds} seconds`, }, ], }; },
- src/tools/wait-seconds.ts:8-10 (schema)Zod schema defining the input parameter 'seconds' as a coerced number.parameters: z.object({ seconds: z.coerce.number(), }),
- src/tools/wait-seconds.ts:4-24 (registration)Function that registers the 'wait-seconds' tool on the FastMCP server by calling addTool with name, description, schema, and execute handler.export function registerWaitSecondsTools(server: FastMCP): void { server.addTool({ name: "wait-seconds", description: "Wait the given seconds.", parameters: z.object({ seconds: z.coerce.number(), }), execute: async (args) => { const seconds = args.seconds; await wait(seconds * 1000); return { content: [ { type: "text", text: `Wait for ${seconds} seconds`, }, ], }; }, }); };
- src/tools/register-tools.ts:57-57 (registration)Invocation of the registerWaitSecondsTools function within the central registerTools function to add the wait-seconds tool.registerWaitSecondsTools(server);
- src/tools/wait-seconds.ts:26-32 (helper)Helper utility function that returns a Promise resolving after the specified timeout in milliseconds using setTimeout.async function wait(timeout: number) { return new Promise((resolve) => { setTimeout(() => { resolve(undefined); }, timeout); }); }