Skip to main content
Glama
Jake-loranger

Algorand MCP Server

get_current_time

Retrieve the current time for any specified timezone to synchronize blockchain operations with local or global time requirements.

Instructions

Get the current time in a specified timezone

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timezoneNoTimezone identifier (e.g., "UTC", "America/New_York")

Implementation Reference

  • Handler for the 'get_current_time' tool: parses optional timezone argument, formats current date using toLocaleString, handles invalid timezones with error response.
    case 'get_current_time': {
        const parsed = GetTimeArgsSchema.parse(args);
        const timezone = parsed.timezone || 'UTC';
    
        try {
            const now = new Date();
            const timeString = now.toLocaleString('en-US', {
                timeZone: timezone,
                weekday: 'long',
                year: 'numeric',
                month: 'long',
                day: 'numeric',
                hour: '2-digit',
                minute: '2-digit',
                second: '2-digit',
                timeZoneName: 'short',
            });
    
            return {
                content: [
                    {
                        type: 'text',
                        text: `Current time in ${timezone}: ${timeString}`,
                    },
                ],
            };
        } catch (error) {
            return {
                content: [
                    {
                        type: 'text',
                        text: `Error: Invalid timezone "${timezone}" - ${error}`,
                    },
                ],
                isError: true,
            };
        }
    }
  • Zod schema used for input validation in the get_current_time handler: optional 'timezone' string.
    const GetTimeArgsSchema = z.object({
        timezone: z.string().optional(),
    });
  • src/index.ts:128-141 (registration)
    Tool registration in TOOLS array: defines name, description, and input schema for MCP listTools response.
    {
        name: 'get_current_time',
        description: 'Get the current time in a specified timezone',
        inputSchema: {
            type: 'object',
            properties: {
                timezone: {
                    type: 'string',
                    description: 'Timezone identifier (e.g., "UTC", "America/New_York")',
                },
            },
            required: [],
        },
    },
  • MCP protocol input schema for get_current_time tool as registered in TOOLS.
    inputSchema: {
        type: 'object',
        properties: {
            timezone: {
                type: 'string',
                description: 'Timezone identifier (e.g., "UTC", "America/New_York")',
            },
        },
        required: [],
    },

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/Jake-loranger/algorand-mcp-server'

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