Skip to main content
Glama

Wyszukiwanie w treści aktu

search_in_act
Read-onlyIdempotent

Search a term inside a loaded legal act to retrieve contextual hits with pagination and section details. Load the act content first.

Instructions

Wyszukaj termin w treści załadowanego aktu prawnego.

WYMAGANIE: Akt musi być wcześniej załadowany za pomocą get_act_details(eli=..., load_content=True).

Zwraca jedną stronę trafień z kontekstem, metadanymi paginacji i informacją o sekcji.

Przykłady:

  • search_in_act(eli="DU/2024/1692", query="straż") - Znajdź "straż" w akcie

  • search_in_act(eli="DU/2024/1692", query="obowiązek", context_chars=200) - Z krótszym kontekstem

  • search_in_act(eli="DU/2024/1692", query="art. 5", limit=10, offset=0) - Pierwsza strona trafień

  • search_in_act(eli="DU/2024/1692", query="kara", limit=5, offset=5) - Kolejna strona trafień

  • search_in_act(eli="DU/2024/1692", query="termin") - Domyślna strona (do 20 trafień)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
eliYesIdentyfikator ELI aktu. Format: "{wydawca}/{rok}/{pozycja}". Wydawcy: DU (Dziennik Ustaw), MP (Monitor Polski). Przykłady: "DU/2024/1716", "MP/2023/500", "DU/2024/1". Akt MUSI być wcześniej załadowany przez get_act_details(eli=..., load_content=True).
limitNoMaksymalna liczba trafień na stronie. Domyślnie 20, maksimum 100.
queryYesTermin do wyszukania w treści aktu (np. 'podatek', 'obowiązek', 'art. 5'). Wielkość liter jest ignorowana.
offsetNoNieujemne przesunięcie początku strony. Domyślnie 0.
context_charsNoLiczba znaków kontekstu przed i po każdym trafieniu. Domyślnie 500. Maksymalnie 2000 — wartości większe są przycinane do 2000, a odpowiedź zawiera wtedy wskazówkę o przycięciu. Wywołanie nie kończy się błędem.

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. Changed15 schema fields changedv3.1.0
    • changedInput schema / properties / context_chars / description
      Previous value: -"Liczba znaków kontekstu przed i po każdym trafieniu. Domyślnie 500."New value: +"Liczba znaków kontekstu przed i po każdym trafieniu. Domyślnie 500. Maksymalnie 2000 — wartości większe są przycinane do 2000, a odpowiedź zawiera wtedy wskazówkę o przycięciu. Wywołanie nie kończy się błędem."
    • addedInput schema / properties / context_chars / title
      Added value: +"Context Chars"
    • addedInput schema / properties / eli / title
      Added value: +"Eli"
    • addedInput schema / properties / limit
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "integer"
      +    }
      +  ],
      +  "default": 20,
      +  "description": "Maksymalna liczba trafień na stronie. Domyślnie 20, maksimum 100.",
      +  "title": "Limit"
      +}
    • addedInput schema / properties / offset
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "integer"
      +    }
      +  ],
      +  "default": 0,
      +  "description": "Nieujemne przesunięcie początku strony. Domyślnie 0.",
      +  "title": "Offset"
      +}
    • addedInput schema / properties / query / title
      Added value: +"Query"
    • addedInput schema / title
      Added value: +"search_in_actArguments"
    • addedOutput schema / $defs
      Added value: +{
      +  "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"
      +  },
      +  "PageInfo": {
      +    "description": "Metadata describing one bounded response page.",
      +    "properties": {
      +      "limit": {
      +        "minimum": 0,
      +        "title": "Limit",
      +        "type": "integer"
      +      },
      +      "next_offset": {
      +        "anyOf": [
      +          {
      +            "minimum": 0,
      +            "type": "integer"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "title": "Next Offset"
      +      },
      +      "offset": {
      +        "minimum": 0,
      +        "title": "Offset",
      +        "type": "integer"
      +      },
      +      "returned_count": {
      +        "minimum": 0,
      +        "title": "Returned Count",
      +        "type": "integer"
      +      },
      +      "total_count": {
      +        "minimum": 0,
      +        "title": "Total Count",
      +        "type": "integer"
      +      },
      +      "unit": {
      +        "$ref": "#/$defs/PageUnit"
      +      },
      +      "was_truncated": {
      +        "title": "Was Truncated",
      +        "type": "boolean"
      +      }
      +    },
      +    "required": [
      +      "limit",
      +      "offset",
      +      "returned_count",
      +      "total_count",
      +      "was_truncated",
      +      "unit"
      +    ],
      +    "title": "PageInfo",
      +    "type": "object"
      +  },
      +  "PageUnit": {
      +    "description": "Unit represented by a page.",
      +    "enum": [
      +      "items",
      +      "characters"
      +    ],
      +    "title": "PageUnit",
      +    "type": "string"
      +  },
      +  "SearchInActOutput": {
      +    "description": "Output for search within act.",
      +    "properties": {
      +      "context_chars_applied": {
      +        "default": 500,
      +        "title": "Context Chars Applied",
      +        "type": "integer"
      +      },
      +      "context_chars_requested": {
      +        "default": 500,
      +        "title": "Context Chars Requested",
      +        "type": "integer"
      +      },
      +      "eli": {
      +        "title": "Eli",
      +        "type": "string"
      +      },
      +      "matches": {
      +        "items": {
      +          "additionalProperties": true,
      +          "type": "object"
      +        },
      +        "title": "Matches",
      +        "type": "array"
      +      },
      +      "page_info": {
      +        "$ref": "#/$defs/PageInfo"
      +      },
      +      "query": {
      +        "title": "Query",
      +        "type": "string"
      +      },
      +      "total_matches": {
      +        "title": "Total Matches",
      +        "type": "integer"
      +      }
      +    },
      +    "required": [
      +      "eli",
      +      "query",
      +      "matches",
      +      "total_matches",
      +      "page_info"
      +    ],
      +    "title": "SearchInActOutput",
      +    "type": "object"
      +  }
      +}
    • addedOutput schema / properties / data
      Added value: +{
      +  "$ref": "#/$defs/SearchInActOutput",
      +  "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[SearchInActOutput]"
    • removedOutput schema / x-fastmcp-wrap-result
      Removed value: -true
  3. Addedv1.0.2

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already cover read-only/idempotent safety, and the description adds a stateful dependency (prior load required) that annotations cannot express. It also discloses the return shape — one page of hits with context, pagination metadata, and section info — plus clamping behavior for context_chars. This exceeds what the annotation hints alone provide.

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 front-loaded with purpose, then a single-line requirement, a compact return summary, and five examples that each demonstrate a distinct parameter combination. No sentence is wasted and the structure makes the requirement immediately scannable.

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?

With an output schema present, return values need not be detailed, yet the description still summarizes the response. The stateful prerequisite, pagination semantics, default limit, and case-insensitivity are all covered across description and schema, leaving no gaps for an agent to call 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 description coverage is 100%, so the baseline is 3, but the examples add value beyond the schema by demonstrating parameter interplay: limit/offset paging patterns (limit=5, offset=5 as the next page) and context_chars usage. The default page of up to 20 hits is reinforced by example, aligning with the schema's default values.

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 opening sentence states a specific verb and resource: 'Wyszukaj termin w treści załadowanego aktu prawnego' (search a term in the content of a loaded legal act). The qualifier 'załadowanego' distinguishes it from sibling search_legal_acts, which searches the corpus, making the tool's scope unambiguous.

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?

The WYMAGANIE block gives an explicit prerequisite: the act must be loaded via get_act_details(eli=..., load_content=True) before searching. This is clear context, though the description does not name search_legal_acts as the alternative for corpus-wide searches or state explicit when-not conditions.

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