Skip to main content
Glama

write_query

Run one SQL INSERT, UPDATE, upsert, REPLACE, or CREATE statement on SQLite and return the affected row count; oversized UPDATEs are rolled back to prevent accidental full-table rewrites.

Instructions

Run one data or additive-schema statement and return the affected row count. Refuses DELETE, DROP, ALTER and triggers: those need destructive_query. An UPDATE that touches more rows than the configured cap is rolled back, so a forgotten WHERE clause cannot rewrite a whole table by accident. RETURNING clauses come back as CSV.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesOne INSERT, UPDATE, upsert, REPLACE, CREATE TABLE, CREATE INDEX or CREATE VIRTUAL TABLE (fts5, rtree) statement.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations (destructiveHint=false, readOnlyHint=false) are consistent with the description, and the description goes well beyond them: it discloses the refusal list, the row-cap rollback safeguard against forgotten WHERE clauses, and that RETURNING output arrives as CSV. That is exactly the behavioral context annotations cannot carry.

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?

Three sentences, all front-loaded and each earning its place: purpose and return value first, then the refusal/rejection list, then the safety cap and output format. No filler or repetition.

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

Completeness5/5

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

No output schema exists, yet the description states the return shape (affected row count, or CSV for RETURNING). Refusals, rollback conditions, and alternative tool are all covered, leaving nothing an agent needs in order to call it correctly.

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?

Schema description coverage is 100% and the parameter description already enumerates the accepted statement types, so the schema does the heavy lifting. The description adds only the RETURNING-as-CSV detail; baseline 3 is appropriate for a single fully-documented parameter.

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

Purpose5/5

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

States a specific verb and resource ('Run one data or additive-schema statement') plus the return value (affected row count), and explicitly names the sibling it is not ('those need destructive_query'). An agent can distinguish it from read_query and destructive_query without opening any schema.

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

Usage Guidelines5/5

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

Gives explicit when-not guidance: DELETE, DROP, ALTER and triggers are refused, and names destructive_query as the alternative. It also states the condition that causes rollback (exceeding the row cap), so the agent knows the guardrails before invoking.

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