Gemini Run Code Tool
gemini_run_code_toolExecute Python code with Gemini to answer questions, perform calculations, or process data. Provide a prompt and optional data, and it writes and runs the code.
Instructions
Execute code using Gemini's built-in code execution.
Gemini writes and runs Python code to answer questions, perform calculations, or process data.
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": {
"prompt": "<prompt>"
},
"name": "gemini_run_code_tool"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | Optional data to process. | |
| model | No | Model to use. | flash |
| prompt | Yes | Description of what code to write and run. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||