Skip to main content
Glama

wait-seconds

Pause execution for a specified number of seconds within MCPilot, enabling precise timing for blockchain interactions and workflow synchronization without exposing private keys.

Instructions

Wait the given seconds

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
secondsYes

Implementation Reference

  • The execute handler for the 'wait-seconds' tool, which extracts the seconds parameter, waits for that duration in milliseconds using the wait helper, and returns a structured text response confirming the wait.
    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 parameters for the wait-seconds tool: an object with a 'seconds' field coerced to number.
    parameters: z.object({ seconds: z.coerce.number() }),
  • Local registration of the wait-seconds tool within the registerWaitSecondsTools function using server.addTool, including name, description, schema, and handler.
    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`, }, ], } }, });
  • Global registration call in the main server file, invoking registerWaitSecondsTools to add the tool to the FastMCP server instance.
    registerWaitSecondsTools(server);
  • Utility helper function that creates a Promise-based delay using setTimeout for the specified timeout in milliseconds.
    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/mcpilot'

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