Skip to main content
Glama

wait-seconds

Pause execution for a specified number of seconds during blockchain operations. Use this tool to manage timing in automated workflows or wait for transaction confirmations.

Instructions

Wait the given seconds.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
secondsYes

Implementation Reference

  • The execute function for the 'wait-seconds' tool, which waits for the specified number of seconds using the wait helper and returns a text response.
    execute: async (args) => { const seconds = args.seconds; await wait(seconds * 1000); return { content: [ { type: "text", text: `Wait for ${seconds} seconds`, }, ], }; },
  • Zod schema defining the input parameter 'seconds' as a coerced number.
    parameters: z.object({ seconds: z.coerce.number(), }),
  • The registerWaitSecondsTools function that adds the 'wait-seconds' tool to the FastMCP server using server.addTool, including name, description, schema, and 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`, }, ], }; }, }); };
  • Invocation of registerWaitSecondsTools(server) as part of the central registerTools function.
    registerWaitSecondsTools(server);
  • Utility function 'wait' that creates a Promise resolved after the specified timeout in milliseconds using setTimeout.
    async function wait(timeout: number) { return new Promise((resolve) => { setTimeout(() => { resolve(undefined); }, timeout); }); }

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/Xiawpohr/metamask-mcp'

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