Saltar a contenido

Tools

query_database

Ejecuta una query SELECT contra la base de datos de tu clínica. Solo lectura.

Args: { sql: string }

curl -X POST https://mcp.wiservet.com/tools/query_database/invoke \
  -H "Authorization: Bearer wsv_..." \
  -d '{"sql": "SELECT id, total_amount FROM visits ORDER BY visit_date DESC LIMIT 5"}'

Restricciones automáticas: - Solo SELECT o WITH ... SELECT (CTE). - Multi-statement (;) bloqueado. - DML/DDL bloqueado vía regex y grants. - pg_authid, pg_read_file, dblink bloqueados. - Limite 200 filas (cap server-side). - statement_timeout = 5000ms.

list_tables

Lista tablas accesibles + comments + tamaño en disco.

curl -X POST https://mcp.wiservet.com/tools/list_tables/invoke \
  -H "Authorization: Bearer wsv_..." -d '{}'

describe_table

Devuelve schema (columnas, tipos, nullable, defaults) de una tabla.

Args: { table: string } — debe ser snake_case.

curl -X POST https://mcp.wiservet.com/tools/describe_table/invoke \
  -H "Authorization: Bearer wsv_..." \
  -d '{"table": "visits"}'

get_clinic_context

Atajo agregado: revenue del día + visitas + ticket + nuevos tutores + alertas activas.

curl -X POST https://mcp.wiservet.com/tools/get_clinic_context/invoke \
  -H "Authorization: Bearer wsv_..." -d '{}'

Errores comunes

Status Causa Mitigación
401 API key inválida o expirada Genera una nueva
403 Falta el scope necesario Revisa los scopes asignados
429 Rate limit diario excedido Espera al rollover UTC o solicita aumento
400 SQL bloqueado por sql_guard Lee la respuesta error.reason
500 Falla interna Retry exponencial o reporta a soporte