Gemini Sessions
gemini-sessionsList active Gemini sessions or export a session's full conversation history as JSON or Markdown, optionally limiting exports to the last N turns.
Instructions
List or export Gemini sessions. If sessionId is omitted, returns the list of active sessions (id, lastAccessed, turnCount, expiresAt). If sessionId is provided, returns the full conversation history (turns + pre-rendered content) in the requested format.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "gemini-sessions"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lastN | No | Only used when sessionId is provided. Export only the last N individual messages (turns). A single user+assistant exchange is 2 turns. | |
| format | No | Export format (only used when sessionId is provided; default: json). | |
| sessionId | No | Optional. When omitted, returns the list of active sessions. When provided, returns the full conversation history of that session. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||