Skip to main content
Glama
truaxki
by truaxki

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
NameRequiredDescriptionDefault
queryYesNon-SELECT SQL query to execute

Implementation Reference

  • 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))]
  • 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"]
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool executes queries but doesn't mention critical aspects like whether it requires specific permissions, if changes are reversible, potential side effects (e.g., data loss), error handling, or transaction behavior. This is a significant gap for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function without any unnecessary words. It is front-loaded with the core action and resource, making it easy to parse and understand quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a mutation tool with no annotations and no output schema, the description is incomplete. It lacks information on behavioral traits (e.g., safety, permissions), expected outputs, error conditions, and how it differs from sibling tools. This leaves the agent with insufficient context for reliable tool selection and invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with the single parameter 'query' documented as a 'Non-SELECT SQL query to execute'. The description adds value by specifying the allowed query types (INSERT, UPDATE, DELETE), which clarifies the parameter's semantics beyond the schema's generic 'Non-SELECT' label. However, it doesn't provide additional details like syntax examples or constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs (INSERT, UPDATE, DELETE) and resource (query), making it evident this executes data manipulation SQL statements. However, it doesn't explicitly distinguish itself from sibling tools like 'create_table' or 'log-query', which might also involve database operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'read_query' for SELECT queries or 'create_table' for table creation. It mentions the types of queries (INSERT, UPDATE, DELETE) but doesn't specify contexts, prerequisites, or exclusions, leaving the agent to infer usage from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/truaxki/mcp-variance-log'

If you have feedback or need assistance with the MCP directory API, please join our Discord server