Skip to main content
Glama
pshempel

MCP Time Server Node

by pshempel

get_server_info

Retrieve server version and build details from the MCP Time Server Node to ensure accurate time manipulation and query handling capabilities.

Instructions

Get server version and build information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function that executes the tool logic, retrieving server version from package.json, git revision/branch/dirty status, Node.js version, and system timezone.
    export function getServerInfo(_params?: unknown): ServerInfo { debug.server('getServerInfo called'); // Try to read build-time version info first const versionJson = readVersionJson(); // Always use package.json for version (source of truth) const version = getPackageVersion(); // Use build-time info if available, otherwise detect at runtime const revision = versionJson?.revision ?? getGitRevision(); const branch = versionJson?.branch ?? getGitBranch(); // Build the response const info: ServerInfo = { version, revision, branch, node_version: process.version, timezone: Intl.DateTimeFormat().resolvedOptions().timeZone, }; // Add optional fields if available if (versionJson?.buildDate) { info.build_date = versionJson.buildDate; } if (versionJson?.buildNumber) { info.build_number = versionJson.buildNumber; } // Include dirty status if available const dirty = versionJson?.dirty ?? getGitDirtyStatus(); if (dirty !== undefined) { info.dirty = dirty; } debug.server('getServerInfo returning: v%s, rev: %s, branch: %s', version, revision, branch); return info; }
  • TypeScript interface defining the output structure of the getServerInfo tool.
    interface ServerInfo { version: string; revision: string; branch: string; dirty?: boolean; build_date?: string; build_number?: string; node_version: string; timezone: string; }
  • Tool metadata definition including the tool name, description, and empty input schema (no parameters required).
    { name: 'get_server_info', description: 'Get server version and build information', inputSchema: { type: 'object' as const, properties: {}, }, },
  • src/index.ts:257-257 (registration)
    Mapping of the tool name 'get_server_info' to the getServerInfo handler function in the TOOL_FUNCTIONS object used for dynamic tool execution.
    get_server_info: (params: unknown) => getServerInfo(params),
  • src/tools/index.ts:8-8 (registration)
    Re-export of the getServerInfo function from its implementation file, making it available for import in src/index.ts.
    export { getServerInfo } from './getServerInfo';

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/pshempel/mcp-time-server-node'

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