Skip to main content
Glama
ref-tools

Widget MCP

by ref-tools

timer

Set a timer for any task by entering the duration in seconds. The Widget MCP server integrates interactive tools into chats, providing visual timers for efficient time management.

Instructions

Start a timer. You don't need to say anything else after answering with this tool.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
durationYesThe duration of the timer in seconds

Implementation Reference

  • index.ts:15-37 (registration)
    Registration of the 'timer' MCP tool, including schema and handler function.
    server.registerTool(
      "timer",
      {
        title: "Timer",
        description:
          "Start a timer. You don't need to say anything else after answering with this tool.",
        inputSchema: {
          duration: z.number().describe("The duration of the timer in seconds"),
        },
      },
      async ({ duration }) => {
        const timerResource = createTemplatedUIResource(
          createUIResource,
          "ui://widget/timer",
          timerHtml,
          { duration, mode: "timer" }
        );
    
        return {
          content: [timerResource],
        };
      }
    );
  • index.ts:25-37 (handler)
    Handler function that creates a templated UI resource for the timer widget based on the input duration.
      async ({ duration }) => {
        const timerResource = createTemplatedUIResource(
          createUIResource,
          "ui://widget/timer",
          timerHtml,
          { duration, mode: "timer" }
        );
    
        return {
          content: [timerResource],
        };
      }
    );
  • Input schema definition for the 'timer' tool using Zod, specifying the duration parameter.
    {
      title: "Timer",
      description:
        "Start a timer. You don't need to say anything else after answering with this tool.",
      inputSchema: {
        duration: z.number().describe("The duration of the timer in seconds"),
      },
    },
Install Server

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/ref-tools/widget-mcp'

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