export_to_json
Execute SQL SELECT queries and export the results directly to JSON files for data analysis, sharing, or integration with other applications.
Instructions
Export query results to a JSON file.
Args:
query: SQL SELECT query to execute
filename: Output filename (relative or absolute path)
Returns:
Dictionary with:
- status: 'success' or error
- path: Absolute path to created file
- row_count: Number of rows exported
- file_size: Size of created file in bytes
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": {
"query": "<query>",
"filename": "<filename>"
},
"name": "export_to_json"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| filename | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||