write_query
Execute INSERT, UPDATE, or DELETE queries to log statistical variations and unusual conversation events to a SQLite database.
Instructions
Execute an INSERT, UPDATE, or DELETE query
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Non-SELECT SQL query to execute |
Implementation Reference
- src/mcp_variance_log/server.py:371-375 (handler)Handler for the 'write_query' tool. Validates that the provided query is not a SELECT statement and executes it on the database using db._execute_query.if name == "write_query": if arguments["query"].strip().upper().startswith("SELECT"): raise ValueError("SELECT queries are not allowed for write_query") results = db._execute_query(arguments["query"]) return [types.TextContent(type="text", text=str(results))]
- src/mcp_variance_log/server.py:184-197 (registration)Registration of the 'write_query' tool within the list_tools handler, defining its name, description, and JSON schema for input validation.types.Tool( name="write_query", description="Execute an INSERT, UPDATE, or DELETE query", inputSchema={ "type": "object", "properties": { "query": { "type": "string", "description": "Non-SELECT SQL query to execute" } }, "required": ["query"] } ),
- JSON Schema definition for the 'write_query' tool input, specifying a required 'query' string parameter.inputSchema={ "type": "object", "properties": { "query": { "type": "string", "description": "Non-SELECT SQL query to execute" } }, "required": ["query"] }