get_datetime
Retrieves the current date and time in a specified format or custom pattern, optionally using an IANA timezone instead of the server's local time.
Instructions
Get the current date and time in the given format.
The time is in the local timezone of the machine running the server, unless 'timezone' is given as an IANA name such as 'Asia/Tokyo' or 'UTC'.
'format' is one of the format names below, or a custom pattern containing '%'. Custom patterns accept strftime directives (%Y %m %d %H %M %S %a %A %b %B %z %Z %j ...), %-m %-d %-H %-M %-S %-I %-j %-y for no leading zero, and these Japanese directives: %Je era name (令和), %JE era initial (R), %Jy era year (元 for year 1), %JY era year (always a number), %Ja weekday (火), %JA weekday (火曜日). Example: '%Je%Jy年%-m月%-d日(%Ja)' -> 令和6年12月10日(火). Japanese era is supported from 1873-01-01.
Available formats (example: 2024-12-10 00:54:01 JST):
date: 2024-12-10
date_slash: 2024/12/10
date_jp: 2024年12月10日
datetime: 2024-12-10 00:54:01
datetime_jp: 2024年12月10日 00時54分01秒
datetime_t: 2024-12-10T00:54:01
compact: 20241210005401
compact_date: 20241210
compact_time: 005401
filename_md: 20241210005401.md
filename_txt: 20241210005401.txt
filename_log: 20241210005401.log
iso: 2024-12-10T00:54:01+0900
iso_basic: 20241210T005401+0900
log: 2024-12-10 00:54:01.123456
log_compact: 20241210_005401
time: 00:54:01
time_jp: 00時54分01秒
date_wareki: 令和6年12月10日
datetime_wareki: 令和6年12月10日 00時54分01秒
date_wareki_short: R6.12.10
date_jp_weekday: 2024年12月10日(火)
datetime_jp_weekday: 2024年12月10日(火) 00時54分01秒
weekday_jp: 火曜日
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"format": "<format>"
},
"name": "get_datetime"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | Yes | Format name such as 'datetime', or a custom pattern containing '%'. See the tool description. | |
| timezone | No | IANA timezone name such as 'Asia/Tokyo', 'UTC' or 'America/New_York'. Omit to use the local timezone of the machine. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |