Skip to main content
Glama

Sumar días hábiles

sumar_dias_habiles
Read-onlyIdempotent

Calculates the date reached by adding business days to a start date under Mexican LFT, CNBV, or SAT calendars, and lists the non-working days skipped.

Instructions

Calcula la fecha que resulta de sumar días hábiles a la fecha desde según el calendario de una autoridad (lft, cnbv o sat), contando desde el día hábil siguiente. En un plazo que corre desde una notificación, desde es el día en que surte efectos, no el día en que se hizo. Con sat, tipo_plazo es obligatorio: en declaraciones_pagos las vacaciones del SAT cuentan como hábiles (CFF, artículo 12) y en general no; con lft o cnbv no se acepta. Devuelve la fecha resultante y los días inhábiles saltados con su fuente. Las advertencias dicen lo que el cálculo no descuenta: con lft, los festivos y las suspensiones de labores del artículo 715; con declaraciones_pagos, la prórroga del quinto párrafo del artículo 12 si el resultado cae en viernes, en vacaciones del SAT o en un cierre bancario, o fuera de las vacaciones publicadas. Si el calendario no cubre el periodo responde con error; con permitir_incompleto: true calcula de todos modos y lo advierte. Es una calculadora, no asesoría legal. Consulta la API de MéxicoAPI (la pública, o la de MEXICOAPI_BASE) y, si no responde, usa los datos del paquete y lo advierte. Con MEXICOAPI_SIN_RED=1 responde con los datos del paquete, sin red.

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": {
      "autoridad": "<autoridad>",
      "desde": "<desde>",
      "dias": "<dias>"
    },
    "name": "sumar_dias_habiles"
  }
}

Input Schema

NameRequiredDescriptionDefault
diasYesDías hábiles a sumar, de 1 a 3650.
desdeYesFecha de partida (AAAA-MM-DD), que no se cuenta: en un plazo que corre desde una notificación, el día en que surte efectos.
autoridadYeslft: sábados, domingos y días de descanso obligatorio del artículo 74 de la Ley Federal del Trabajo, sin los festivos del calendario oficial ni los días en que las autoridades laborales suspenden labores (artículo 715); cnbv: calendario bancario, los días en que cierran las entidades financieras (no el de la CNBV como autoridad); sat: Código Fiscal de la Federación, artículo 12, por regla, y vacaciones del SAT.
tipo_plazoNoSolo con autoridad sat, y ahí obligatorio.
permitir_incompletoNotrue para calcular fuera de la cobertura del calendario, con advertencia: el resultado puede cambiar cuando se publique lo que falta.

Output Schema

NameRequiredDescriptionDefault
as_ofYesFecha de corte del dataset: la de la última actualización que lo cambió (en los datos curados, la publicación más reciente de sus fuentes). No es la fecha del valor, que va en datos.
datosYes
avisosYesLas advertencias con su código estable: avisos[i].texto es advertencias[i]. Un código desconocido vale como otro.
fuenteYesFuente para citar el dato.
origenYesapi: la API de MéxicoAPI; paquete: los datos y las reglas del paquete mexicoapi, sin red.
fuentesYesTodas las fuentes de la respuesta, empezando por fuente.
advertenciasYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, openWorldHint and idempotentHint, so the safety profile is covered. The description adds genuinely useful behavior: returned warnings about what the calculation does not deduct (art. 715, the fifth-paragraph prórroga), error on uncovered calendars, and network fallback via MEXICOAPI_BASE / MEXICOAPI_SIN_RED. That is above the annotation baseline but stops short of describing pagination or exact response shape details.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded and nearly every sentence carries operational information, including the legal references and the fallback behavior. It is a single dense paragraph with some repetition between the top-level description and the schema field descriptions, but little is genuinely wasted.

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 multi-parameter calculator with legal-calendar edge cases, the description covers the counting convention, conditional parameter requirements, error behavior, override flag, warnings, and offline fallback. Since an output schema exists, it need not detail return values, yet it still names the two result components.

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 coverage is 100%, so the schema already documents all five parameters, and much of the description's parameter talk (tipo_plazo obligatory with sat, permitir_incompleto) duplicates the schema text. It does add real meaning, however, in explaining why vacations count under 'declaraciones_pagos' (CFF art. 12) and that 'desde' is never counted.

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

Purpose4/5

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

States a specific verb and resource: computes the date resulting from adding business days under a named authority calendar (lft, cnbv, sat), including the counting rule (from the next business day). The function is unmistakable, but it never contrasts itself with the sibling dias_inhabiles, so an agent must infer the division of labor from the name alone.

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 concrete when-to-use context (notifications: 'desde' is the effective date, not the notification date) and conditional rules for tipo_plazo ('con sat obligatorio, con lft o cnbv no se acepta') and permitir_incompleto. It does not route to any alternative tool or state when this tool is the wrong choice versus a sibling, which keeps it below a 5.

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