get_system_info
Retrieve system information like current date and timezone for AI assistants to handle time-based queries and date filtering tasks.
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-421 (handler)The handler function for the 'get_system_info' tool. It retrieves the current date, time, and timezone information based on the input parameter 'info' and formats a response accordingly.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)The Zod schema defining the input parameters for the 'get_system_info' tool, specifically the 'info' enum parameter.{ 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)The registration of the 'get_system_info' tool using server.tool(), including name, description, schema, and inline handler.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 }] }; } );