chat
Send messages to Gemini AI with optional file attachments for multimodal analysis, code review, document processing, or image description tasks.
Instructions
SEND MESSAGE TO GEMINI (with optional files) - Chat with Gemini, optionally including uploaded files for multimodal analysis. TYPICAL USE: 0-2 files for most tasks (code review, document analysis, image description). SCALES TO: 40+ files when needed for comprehensive analysis. WORKFLOW: 1) Upload files first using upload_file (single) or upload_multiple_files (multiple), 2) Pass returned URIs in fileUris array, 3) Include your text prompt in message. The server handles file object caching and proper API formatting. Supports conversation continuity via conversationId. RETURNS: response text, token usage, conversation ID. Files are passed as direct objects to Gemini (not fileData structures). Auto-retrieves missing files from API if not cached.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message | Yes | The message to send to Gemini | |
| model | No | The Gemini model to use | gemini-3-pro-preview |
| fileUris | No | Array of file URIs from previously uploaded files | |
| temperature | No | Controls randomness in responses (0.0 to 2.0) | |
| maxTokens | No | Maximum tokens in response | |
| conversationId | No | Optional conversation ID to continue a previous chat |
Implementation Reference
- src/types/gemini.ts:38-43 (schema)Input schema definition for the 'chat' tool, defining arguments like message, optional files, temperature, and maxTokens.export interface ChatArgs { message: string; files?: FileUpload[]; temperature?: number; maxTokens?: number; }
- src/types/gemini.ts:45-55 (schema)Validation function to check if arguments match the ChatArgs schema for the 'chat' tool.export function isValidChatArgs(args: any): args is ChatArgs { return ( typeof args === "object" && args !== null && "message" in args && typeof args.message === "string" && (args.files === undefined || Array.isArray(args.files)) && (args.temperature === undefined || typeof args.temperature === "number") && (args.maxTokens === undefined || typeof args.maxTokens === "number") ); }