Skip to main content
Glama
pshempel

MCP Time Server Node

by pshempel

get_server_info

Retrieve version and build details to verify server status and compatibility for time manipulation operations.

Instructions

Get server version and build information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function implementing the get_server_info tool. It collects server version from package.json, git revision/branch/dirty status, Node version, and 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 structure of the ServerInfo object returned by the getServerInfo tool.
    interface ServerInfo {
      version: string;
      revision: string;
      branch: string;
      dirty?: boolean;
      build_date?: string;
      build_number?: string;
      node_version: string;
      timezone: string;
    }
  • src/index.ts:33-40 (registration)
    Tool registration in TOOL_DEFINITIONS array, specifying name, description, and empty input schema for the tools/list endpoint.
    {
      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 tool name 'get_server_info' to the getServerInfo handler function in TOOL_FUNCTIONS for tools/call execution.
    get_server_info: (params: unknown) => getServerInfo(params),
  • Helper function to extract version from package.json, used by getServerInfo.
    function getPackageVersion(): string {
      try {
        const packagePath = path.join(__dirname, '../../package.json');
        // eslint-disable-next-line security/detect-non-literal-fs-filename
        const packageContent = fs.readFileSync(packagePath, 'utf8');
        const packageData = JSON.parse(packageContent) as { version?: string };
        return packageData.version ?? '1.0.0';
      } catch {
        return '1.0.0';
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states it 'gets' information (implying read-only), but doesn't disclose any behavioral traits like authentication requirements, rate limits, error conditions, or what format the information returns. For a tool with zero annotation coverage, this is inadequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that states exactly what the tool does with zero wasted words. It's appropriately sized and front-loaded, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete. It doesn't explain what 'server version and build information' entails, how it's returned, or any behavioral context. For a tool that presumably returns system metadata, more detail would help the agent understand what to expect.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and schema description coverage is 100% (empty schema is fully documented). The description doesn't need to add parameter semantics, so it meets the baseline for a parameterless tool. No additional value is needed or provided.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('server version and build information'), making the tool's function immediately understandable. However, it doesn't differentiate from sibling tools, which are all time/date related, so this tool stands alone in purpose but without explicit sibling comparison.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. While the tool's purpose is distinct from its time/date siblings, there's no explicit mention of when it's appropriate or what context triggers its use.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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