get_system_info
Retrieve system information like current date, timezone, or comprehensive details for AI assistants to enhance time-based queries and contextual accuracy.
Instructions
Get system information and utilities for AI assistants. Provides current date, timezone, and other helpful context that AI assistants may not have access to. Use this when you need reference information for date filtering, time-based queries, or other system context.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| info | No | Type of system information to retrieve: "date" for current date only, "timezone" for timezone info, "all" for everything | all |
Implementation Reference
- src/server.ts:391-420 (handler)Handler function that retrieves and formats current date, time, and timezone information based on the input.info parameter.async (input) => { const now = new Date(); const currentDate = now.toISOString().split('T')[0]; const currentTime = now.toISOString(); const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone; let response = ''; if (input.info === 'date') { response = `Current date: ${currentDate}`; } else if (input.info === 'timezone') { response = `Timezone: ${timezone}`; } else { response = [ `Current date: ${currentDate}`, `Current time: ${currentTime}`, `Timezone: ${timezone}`, ``, `Use this date information when applying date filters to search_conversations.`, `Date format for filters: YYYY-MM-DD (e.g., "${currentDate}")` ].join('\n'); } return { content: [{ type: 'text', text: response }] }; }
- src/server.ts:388-390 (schema)Input schema defining the 'info' parameter as a Zod enum for selecting the type of system information.{ info: z.enum(['date', 'timezone', 'all']).optional().default('all').describe('Type of system information to retrieve: "date" for current date only, "timezone" for timezone info, "all" for everything') },
- src/server.ts:385-421 (registration)Registers the 'get_system_info' tool on the McpServer with name, description, input schema, and handler function.server.tool( 'get_system_info', 'Get system information and utilities for AI assistants. Provides current date, timezone, and other helpful context that AI assistants may not have access to. Use this when you need reference information for date filtering, time-based queries, or other system context.', { info: z.enum(['date', 'timezone', 'all']).optional().default('all').describe('Type of system information to retrieve: "date" for current date only, "timezone" for timezone info, "all" for everything') }, async (input) => { const now = new Date(); const currentDate = now.toISOString().split('T')[0]; const currentTime = now.toISOString(); const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone; let response = ''; if (input.info === 'date') { response = `Current date: ${currentDate}`; } else if (input.info === 'timezone') { response = `Timezone: ${timezone}`; } else { response = [ `Current date: ${currentDate}`, `Current time: ${currentTime}`, `Timezone: ${timezone}`, ``, `Use this date information when applying date filters to search_conversations.`, `Date format for filters: YYYY-MM-DD (e.g., "${currentDate}")` ].join('\n'); } return { content: [{ type: 'text', text: response }] }; } );