Skip to main content
Glama

Restaurar banco a partir de SQL

db_restaurar
DestructiveIdempotent

Restore the database by running a SQL file, after backing up the current .h2.db. Stop PJe-Calc first; the exact confirmation phrase is required.

Instructions

Restaura o banco executando um arquivo SQL (gerado por db_backup_sql) via org.h2.tools.RunScript. DESTRUTIVO: exige confirmacao = "SIM, RESTAURAR" e faz backup do .h2.db atual antes. 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
arquivoYesCaminho do .sql a executar.
confirmacaoYesDeve ser exatamente "SIM, RESTAURAR".

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?

Adds significant operational detail beyond annotations: the underlying RunScript mechanism, mandatory confirmation value, automatic backup creation, and PJe-Calc database lock behavior. Annotations cover destructive and idempotent hints, but the description supplies the concrete safety and sequencing requirements.

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 three tightly written sentences, front-loading the action, then the destructive warning and prerequisites, with no wasted content.

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?

Given the destructive nature, no output schema, and rich annotations, the description covers the critical requirements: confirmation value, pre-backup behavior, execution method, and the need to stop the application first. An agent has enough information to invoke it correctly.

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 schema already documents both parameters. The description adds useful context that the SQL file should be generated by db_backup_sql and reiterates the exact confirmation string, though it does not provide new syntax details 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 specific verb and resource: restore the database by executing a SQL file generated by db_backup_sql via org.h2.tools.RunScript. This clearly distinguishes it from siblings like db_backup_sql and db_executar.

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?

Explicitly warns that the operation is destructive, requires the exact confirmation string, automatically backs up the current .h2.db, and instructs the agent to stop PJe-Calc via pjecalc_parar before using database tools. This provides clear preconditions and usage context.

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