Skip to main content
Glama

fluig_db_query

Query Fluig's AppDS database with SELECT statements to inspect process events, definitions, and FDN tables. Each call writes a dataset and history record; production requires confirmation.

Instructions

SELECT no banco do Fluig (TOTVSECM, /jdbc/AppDS). Lê qualquer tabela: event_proces (eventos de processo, SEM widget), DEF_PROCES, FDN_*, etc. ⚠️ A CONSULTA é read-only, mas a TOOL NÃO É: para executar SQL arbitrário o Fluig exige que ele viva num dataset, então cada chamada grava ds_claude_dbquery no servidor e registra o SQL em FDN_DATASETHISTORY (imutável pela API). Em env="prod" exige confirm=true por causa disso.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "sql": "<sql>",
      "env": "<env>"
    },
    "name": "fluig_db_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
envYesOBRIGATÓRIO. Ambiente alvo: "teste" (homologação, o host de FLUIG_HOST) ou "prod" (PRODUÇÃO REAL, o host de FLUIG_HOST_PROD). Não há default: a escolha é sempre explícita, para que ninguém leia homologação achando que é produção nem escreva em produção achando que é teste.
sqlYesSELECT ... (somente SELECT/WITH)
confirmNoobrigatório em env="prod": ciente de que grava dataset e histórico em produção

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.3.0
    • addedInput schema / properties / confirm
      Added value: +{
      +  "description": "obrigatório em env=\"prod\": ciente de que grava dataset e histórico em produção",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / env
      Added value: +{
      +  "description": "OBRIGATÓRIO. Ambiente alvo: \"teste\" (homologação, o host de FLUIG_HOST) ou \"prod\" (PRODUÇÃO REAL, o host de FLUIG_HOST_PROD). Não há default: a escolha é sempre explícita, para que ninguém leia homologação achando que é produção nem escreva em produção achando que é teste.",
      +  "enum": [
      +    "teste",
      +    "prod"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / sql / description
      Previous value: -"SELECT ... (SELECT/WITH only)."New value: +"SELECT ... (somente SELECT/WITH)"
    • changedInput schema / required
      Previous value: -[
      -  "sql"
      -]New value: +[
      +  "sql",
      +  "env"
      +]
  2. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations at all, the description carries the full burden and does it well: it discloses that although the SELECT is read-only the tool is not, because Fluig requires SQL to live in a dataset, so each call writes ds_claude_dbquery and logs to FDN_DATASETHISTORY (immutable via the API). That side-effect disclosure plus the prod/confirm gate is exactly the behavioral context an agent needs before calling.

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?

Four dense sentences, front-loaded with purpose, then scope, then the warning about side effects, then the prod gate. Nothing is redundant and the most safety-critical fact is placed before the calling detail.

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

Completeness4/5

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

Covers the essentials for a 3-param, no-output-schema tool with a mutation side effect: what it reads, what it writes, and the prod safeguard. It stops short of saying what a result set looks like or whether rows are capped, which matters for arbitrary SQL but is a minor gap given no output schema exists.

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%, so env, sql and confirm are already fully documented in the schema, including the prod/confirm rule. The description reinforces the prod write rationale but adds no syntax, limits, or format detail beyond what the schema states.

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 (SELECT on the Fluig database, TOTVSECM at /jdbc/AppDS) and names concrete tables (event_proces, DEF_PROCES, FDN_*) to bound scope. The database identity implicitly separates it from the RM-query siblings, so an agent can tell what it reads without opening the schema.

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

Usage Guidelines4/5

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

Gives clear context for legitimate use (arbitrary read of any Fluig table, e.g. process events without the widget) and a hard condition for prod (confirm=true). It never explicitly names an alternative such as fluig_rm_db_query or fluig_dataset_run, so routing between the two query tools is left to inference.

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

Deploy Server

Other Tools