Skip to main content
Glama

record_and_gif

Record browser pages as GIFs by opening URLs, capturing screen activity for a set duration, and converting recordings into shareable animated images for simple demos.

Instructions

All-in-one: open URL, wait for specified duration, stop recording, convert to GIF. Best for simple demos.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to record
durationSecondsNoHow long to record (default 5 seconds)
widthNoViewport width
heightNoViewport height
gifFpsNoGIF frame rate
gifWidthNoGIF width (height auto-scaled)

Implementation Reference

  • The implementation of the 'record_and_gif' tool, which orchestrates recording, waiting, stopping, and converting the video to a GIF.
    mcp.tool(
      'record_and_gif',
      'All-in-one: open URL, wait for specified duration, stop recording, convert to GIF. Best for simple demos.',
      {
        url: z.string().describe('URL to record'),
        durationSeconds: z.number().optional().default(5).describe('How long to record (default 5 seconds)'),
        width: z.number().optional().default(1280).describe('Viewport width'),
        height: z.number().optional().default(720).describe('Viewport height'),
        gifFps: z.number().optional().default(10).describe('GIF frame rate'),
        gifWidth: z.number().optional().default(640).describe('GIF width (height auto-scaled)')
      },
      async ({ url, durationSeconds, width, height, gifFps, gifWidth }) => {
        try {
          const rec = await startRecording(url, { width, height });
          await new Promise(r => setTimeout(r, durationSeconds * 1000));
          const stop = await stopRecording(rec.sessionId);
          const gif = await convertToGif(stop.webmPath, { fps: gifFps, width: gifWidth });
          return {
            content: [{
              type: 'text',
              text: `Recording complete!\n\nVideo: ${stop.webmPath} (${stop.durationSeconds}s)\nGIF: ${gif.gifPath} (${gif.sizeMB} MB)\n\nReady to use in README or documentation.`
            }]
          };
        } catch (err) {
          return { content: [{ type: 'text', text: `Error: ${err.message}` }], isError: true };
        }
      }

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/mcpware/pagecast'

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