Skip to main content
Glama

Executar DML/DDL no banco H2

db_executar
DestructiveIdempotent

Execute SQL INSERT/UPDATE/DELETE/DDL in the PJe-Calc H2 database with explicit confirmation and automatic backup; stop the app first and use calculation tools for calculations.

Instructions

Executa INSERT/UPDATE/DELETE/DDL no banco H2. PERIGOSO: exige confirmacao = "SIM, EXECUTAR" e cria backup do arquivo .h2.db antes. NÃO use para criar ou alterar cálculos: inserções diretas não avançam as sequências do Hibernate e o PJe-Calc passa a falhar com "Registro duplicado" ao criar cálculos (aconteceu nesta instalação). Para cálculos use calculo_criar. O PJe-Calc mantém o banco bloqueado enquanto está em execução. Encerre o aplicativo (pjecalc_parar) antes de usar as ferramentas de banco.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesComando SQL (DML/DDL).
confirmacaoYesDeve ser exatamente "SIM, EXECUTAR".

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.16.0-mcp.13

TDQS

A4.9/5.0
Behavior5/5

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

Goes well beyond the destructiveHint/readOnlyHint annotations: discloses the mandatory confirmation token, that a .h2.db backup is taken first, that direct inserts desynchronize Hibernate sequences causing 'Registro duplicado' failures, and that the DB file is locked while PJe-Calc runs. That is exactly the consequence-level 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?

Front-loads the danger and the confirmation requirement, then the failure-mode warning, then the locking prerequisite — every sentence carries operational weight despite the length.

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?

For a destructive, no-output-schema mutation tool this covers prerequisites (stop PJe-Calc), safety (backup, confirmation), and the correct alternative path, leaving nothing an agent needs before calling it.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3; the description adds real meaning by explaining what kinds of SQL are dangerous and why (sequence advancement), not just restating the parameter names. The sql parameter itself still gets no format/syntax guidance beyond the schema.

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 precise verb (executa) and resource (banco H2) plus the exact statement classes (INSERT/UPDATE/DELETE/DDL), which cleanly separates it from read-only siblings like db_consultar and backup siblings like db_backup_arquivo.

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 (não use para criar/alterar cálculos; use calculo_criar) and a hard prerequisite (encerre o aplicativo via pjecalc_parar antes de usar as ferramentas de banco). An agent cannot mistake the correct route.

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