Skip to main content
Glama
wuunicorn

紫微斗数 MCP 服务器 (MCPIztro)

by wuunicorn

get_current_time

Retrieve current system time details for accurate Chinese Ziwei Doushu astrology chart calculations and horoscope analysis.

Instructions

获取当前系统时间,返回详细的时间信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The getCurrentTime function implements the core logic for the 'get_current_time' tool, retrieving the current date and time, formatting it into a structured object including year, month, day, hour, minute, second, datetime string, weekday in English and Chinese, and Unix timestamp.
    function getCurrentTime() {
        try {
            const now = new Date();
            const weekdays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
            
            const result = {
                year: now.getFullYear(),
                month: now.getMonth() + 1,
                day: now.getDate(),
                hour: now.getHours(),
                minute: now.getMinutes(),
                second: now.getSeconds(),
                datetime_str: now.toISOString().slice(0, 19).replace('T', ' '),
                weekday: now.toLocaleDateString('en-US', { weekday: 'long' }),
                weekday_cn: weekdays[now.getDay()],
                timestamp: Math.floor(now.getTime() / 1000)
            };
            
            return { success: true, data: result };
        } catch (error) {
            return { success: false, error: error.message };
        }
    }
  • The input schema for the 'get_current_time' tool, defining it as an object with no properties or required fields.
        name: "get_current_time",
        description: "获取当前系统时间,返回详细的时间信息",
        inputSchema: {
            type: "object",
            properties: {},
            required: []
        }
    },
  • The registration and dispatch handler in the tools/call switch case that invokes getCurrentTime() and formats the MCP response.
    case 'get_current_time':
        try {
            const result = getCurrentTime();
            response = {
                jsonrpc: "2.0",
                id: request.id,
                result: {
                    content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
                    isError: false
                }
            };
        } catch (error) {
            response = {
                jsonrpc: "2.0",
                id: request.id,
                result: {
                    content: [{ type: "text", text: `获取时间错误: ${error.message}` }],
                    isError: true
                }
            };
        }
        break;
  • Tool registration in the tools/list response, listing the 'get_current_time' tool with its name, description, and schema.
        name: "get_current_time",
        description: "获取当前系统时间,返回详细的时间信息",
        inputSchema: {
            type: "object",
            properties: {},
            required: []
        }
    },
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions returning '详细的时间信息' (detailed time information), which gives some behavioral context about the output. However, it doesn't disclose other important traits like whether it's read-only, has side effects, requires permissions, or has rate limits—critical for a tool that might be time-sensitive or system-dependent.

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 extremely concise—a single sentence that directly states the purpose and output. It's front-loaded with the core function ('获取当前系统时间') and adds just enough detail about the return value. There's zero wasted text, making it highly efficient.

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

Completeness3/5

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

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose and output type but lacks details on format, timezone handling, or error conditions. For a tool that returns system time, more context on precision or reliability would be helpful, though the low complexity keeps it from being severely incomplete.

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 the input schema has 100% description coverage (though empty). The description doesn't need to add parameter semantics since there are none. A baseline score of 4 is appropriate as it doesn't mislead about parameters and aligns with the schema.

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 tool's purpose: '获取当前系统时间' (get current system time) with the verb '获取' and resource '系统时间'. It's specific about what it does, though it doesn't explicitly differentiate from sibling tools like 'calculate_ziwei' or 'get_horoscope', which appear to be unrelated time/astrology tools.

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. It doesn't mention any context, prerequisites, or exclusions. While the siblings seem unrelated (astrology calculations), the description doesn't clarify this distinction or provide any usage rules.

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/wuunicorn/MCPIztro'

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