Skip to main content
Glama
ref-tools

Widget MCP

by ref-tools

stopwatch

Activate a stopwatch to track elapsed time starting from zero. Ideal for timing tasks or events directly within chat interfaces using interactive widgets.

Instructions

Start a stopwatch that counts up from zero. You don't need to say anything else after answering with this tool.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • index.ts:39-59 (registration)
    Registers the stopwatch tool with an empty input schema and a handler that returns a UI resource.
    server.registerTool(
      "stopwatch",
      {
        title: "Stopwatch",
        description:
          "Start a stopwatch that counts up from zero. You don't need to say anything else after answering with this tool.",
        inputSchema: {},
      },
      async () => {
        const stopwatchResource = createTemplatedUIResource(
          createUIResource,
          "ui://widget/stopwatch",
          timerHtml,
          { mode: "stopwatch" }
        );
    
        return {
          content: [stopwatchResource],
        };
      }
    );
  • index.ts:47-58 (handler)
    The handler function for the stopwatch tool, which creates and returns a templated UI resource using timerHtml in 'stopwatch' mode.
    async () => {
      const stopwatchResource = createTemplatedUIResource(
        createUIResource,
        "ui://widget/stopwatch",
        timerHtml,
        { mode: "stopwatch" }
      );
    
      return {
        content: [stopwatchResource],
      };
    }
  • Input schema for the stopwatch tool, which is empty as no parameters are required.
    {
      title: "Stopwatch",
      description:
        "Start a stopwatch that counts up from zero. You don't need to say anything else after answering with this tool.",
      inputSchema: {},
    },
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