Skip to main content
Glama

Obliczanie terminu prawnego

calculate_legal_date
Read-onlyIdempotent

Calculate legal dates such as deadlines, effective dates, and vacatio legis by adding or subtracting days, months, or years from a base date or today.

Instructions

Oblicz daty na potrzeby prawne (np. terminy, daty wejścia w życie, vacatio legis).

Dodaje lub odejmuje dni, miesiące i lata od daty bazowej (lub dzisiejszej). Wartości dodatnie = przyszłość, ujemne = przeszłość.

Przykłady:

  • calculate_legal_date(days=14) - Termin 14 dni od dziś (np. termin na odwołanie)

  • calculate_legal_date(days=30, base_date="2024-06-01") - 30 dni od 1 czerwca 2024

  • calculate_legal_date(years=1, base_date="2024-01-01") - Rok po 1 stycznia 2024

  • calculate_legal_date(days=-90) - 90 dni wstecz od dziś

  • calculate_legal_date(months=6, days=15) - 6 miesięcy i 15 dni od dziś

  • calculate_legal_date(years=-5, base_date="2024") - 5 lat przed 1 stycznia 2024

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysNoLiczba dni do dodania (+) lub odjęcia (-). Np. days=14 = za 14 dni, days=-14 = 14 dni temu. Domyślnie 0. Wartości logiczne (true/false) są niedozwolone.
yearsNoLiczba lat do dodania (+) lub odjęcia (-). Np. years=1 = za rok, years=-5 = 5 lat temu. Domyślnie 0. Wartości logiczne (true/false) są niedozwolone.
monthsNoLiczba miesięcy do dodania (+) lub odjęcia (-). Np. months=3 = za 3 miesiące, months=-6 = 6 miesięcy temu. Domyślnie 0. Wartości logiczne (true/false) są niedozwolone.
base_dateNoData bazowa. Akceptowane formaty: 'YYYY-MM-DD' (np. '2024-01-15'), 'YYYY-MM' (np. '2024-01' → 2024-01-01), 'YYYY' (np. '2024' → 2024-01-01). Jeśli nie podano, używa dzisiejszej daty.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesThe actual response data
hintsNoSuggested next steps

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv4.4.0
    • removedOutput schema / properties / metadata
      Removed value: -{
      -  "additionalProperties": true,
      -  "description": "Additional metadata",
      -  "title": "Metadata",
      -  "type": "object"
      -}
  2. Changed19 schema fields changedv3.1.0
    • addedInput schema / properties / base_date / title
      Added value: +"Base Date"
    • changedInput schema / properties / days / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "integer"
      -  }
      -]New value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "integer"
      +  },
      +  {
      +    "type": "boolean"
      +  }
      +]
    • changedInput schema / properties / days / description
      Previous value: -"Liczba dni do dodania (+) lub odjęcia (-). Np. days=14 = za 14 dni, days=-14 = 14 dni temu. Domyślnie 0."New value: +"Liczba dni do dodania (+) lub odjęcia (-). Np. days=14 = za 14 dni, days=-14 = 14 dni temu. Domyślnie 0. Wartości logiczne (true/false) są niedozwolone."
    • addedInput schema / properties / days / title
      Added value: +"Days"
    • changedInput schema / properties / months / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "integer"
      -  }
      -]New value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "integer"
      +  },
      +  {
      +    "type": "boolean"
      +  }
      +]
    • changedInput schema / properties / months / description
      Previous value: -"Liczba miesięcy do dodania (+) lub odjęcia (-). Np. months=3 = za 3 miesiące, months=-6 = 6 miesięcy temu. Domyślnie 0."New value: +"Liczba miesięcy do dodania (+) lub odjęcia (-). Np. months=3 = za 3 miesiące, months=-6 = 6 miesięcy temu. Domyślnie 0. Wartości logiczne (true/false) są niedozwolone."
    • addedInput schema / properties / months / title
      Added value: +"Months"
    • changedInput schema / properties / years / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "integer"
      -  }
      -]New value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "integer"
      +  },
      +  {
      +    "type": "boolean"
      +  }
      +]
    • changedInput schema / properties / years / description
      Previous value: -"Liczba lat do dodania (+) lub odjęcia (-). Np. years=1 = za rok, years=-5 = 5 lat temu. Domyślnie 0."New value: +"Liczba lat do dodania (+) lub odjęcia (-). Np. years=1 = za rok, years=-5 = 5 lat temu. Domyślnie 0. Wartości logiczne (true/false) są niedozwolone."
    • addedInput schema / properties / years / title
      Added value: +"Years"
    • addedInput schema / title
      Added value: +"calculate_legal_dateArguments"
    • addedOutput schema / $defs
      Added value: +{
      +  "DateOutput": {
      +    "description": "Output for date calculation.",
      +    "properties": {
      +      "base_date": {
      +        "title": "Base Date",
      +        "type": "string"
      +      },
      +      "calculated_date": {
      +        "title": "Calculated Date",
      +        "type": "string"
      +      },
      +      "days_offset": {
      +        "title": "Days Offset",
      +        "type": "integer"
      +      },
      +      "description": {
      +        "title": "Description",
      +        "type": "string"
      +      },
      +      "months_offset": {
      +        "title": "Months Offset",
      +        "type": "integer"
      +      },
      +      "years_offset": {
      +        "title": "Years Offset",
      +        "type": "integer"
      +      }
      +    },
      +    "required": [
      +      "base_date",
      +      "calculated_date",
      +      "days_offset",
      +      "months_offset",
      +      "years_offset",
      +      "description"
      +    ],
      +    "title": "DateOutput",
      +    "type": "object"
      +  },
      +  "Hint": {
      +    "description": "Hint for next actions or related tools.",
      +    "properties": {
      +      "message": {
      +        "description": "Hint message",
      +        "title": "Message",
      +        "type": "string"
      +      },
      +      "parameters": {
      +        "anyOf": [
      +          {
      +            "additionalProperties": true,
      +            "type": "object"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Suggested parameters",
      +        "title": "Parameters"
      +      },
      +      "tool": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Related tool name",
      +        "title": "Tool"
      +      }
      +    },
      +    "required": [
      +      "message"
      +    ],
      +    "title": "Hint",
      +    "type": "object"
      +  }
      +}
    • addedOutput schema / properties / data
      Added value: +{
      +  "$ref": "#/$defs/DateOutput",
      +  "description": "The actual response data"
      +}
    • addedOutput schema / properties / hints
      Added value: +{
      +  "description": "Suggested next steps",
      +  "items": {
      +    "$ref": "#/$defs/Hint"
      +  },
      +  "title": "Hints",
      +  "type": "array"
      +}
    • addedOutput schema / properties / metadata
      Added value: +{
      +  "additionalProperties": true,
      +  "description": "Additional metadata",
      +  "title": "Metadata",
      +  "type": "object"
      +}
    • removedOutput schema / properties / result
      Removed value: -{
      -  "type": "string"
      -}
    • changedOutput schema / required
      Previous value: -[
      -  "result"
      -]New value: +[
      +  "data"
      +]
    • addedOutput schema / title
      Added value: +"EnrichedResponse[DateOutput]"
    • removedOutput schema / x-fastmcp-wrap-result
      Removed value: -true
  3. Addedv1.0.2

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the tool's safety profile is known. The description adds a minor behavioral cue: it's a pure calculation with no side effects, but nothing beyond that. Since annotations cover the key behavioral aspects, the description's additional value is limited, hence a 3.

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 tight and front-loaded: it states the purpose in the first sentence, explains the arithmetic, and then lists six focused examples. Every sentence earns its place, with no redundancy or fluff. The structure (introduction, rule, examples) is excellent for quick comprehension.

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?

For a tool with 4 optional parameters and an output schema (not shown but indicated), the description covers the essential usage patterns and edge-case formats (e.g., '2024' → '2024-01-01') via base_date description. It does not explain the return format, but that is presumably handled by the output schema. Given the tool's simplicity, the description is complete enough for correct invocation, though it could mention handling of month-end or leap years if relevant—but that's likely covered by the output schema and not necessary here.

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?

The schema already provides full descriptions for all four parameters (coverage 100%). The description goes beyond by offering concrete examples that illustrate parameter combinations (e.g., 'months=6, days=15') and clarifying the sign convention. This adds practical meaning that helps an agent form correct calls. While schema alone is sufficient, the examples and conventions enhance understanding, warranting a score above baseline.

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?

The description clearly states the tool's function: calculating legal dates (deadlines, effective dates, vacatio legis) by adding/subtracting days, months, and years from a base date or today. It distinguishes itself from siblings (which deal with documents, acts, searches) by its computational nature. Specific verb 'calculate' and resource 'legal date' are present.

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

Usage Guidelines3/5

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

The description gives clear examples of how to invoke the tool and explains the sign convention (+future, -past). However, it does not explicitly mention when to use this tool over alternatives or any conditions that would make it inappropriate. Sibling tools are not referenced, so an agent must infer that date calculations belong here based on the purpose. There is no explicit exclusion or alternative routing.

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