Skip to main content
Glama

Contratos que vencen

search_expiring_contracts
Read-onlyIdempotent

Public contracts that MAY END SOON (contratos que vencen): awarded competitive contracts whose estimated end falls within horizon_months (3, 6, 9 or 12; default 12), soonest end first: who is likely to tender next, and when. The end is an ESTIMATE from published data: the date the contract was formalised plus the duration its notice states (estimated_end, a month YYYY-MM); not a stated date and not a forecast that the contract will be re-tendered or by whom. A notice that publishes no duration cannot be estimated and is not listed, so quote coverage (awarded_contracts of the scope, with_estimable_end of them, share) with every total. When extended is true a published modification extends the term and original_end is the end without it. Filters: sector (slug, see list_sectors), comunidad or provincia (place of performance; not both), cpv (one code: the main CPV is it or under it), min_amount / max_amount (tender budget excluding IVA), q (words of the contract title, when Licto's title search is open) and organization_id (one organismo's contracts, as on its page). company_id instead lists the contracts one company holds, as on its page; only horizon_months, cursor and limit combine with it, and a plan without the full list (Profesional and above) gets the 3 nearest with no paging. Returns total (contracts ending inside the horizon, all pages), by_month (per calendar month of the next 12 months, ALWAYS 12 whatever horizon_months, so it can sum to more than total) and items: id, title, estimated_end, budget_eur, sector, cpv, place, organismo (id, name, comunidad, url), the licto.es url and, where Licto publishes them, award_amount_eur (the award, excluding IVA; lot_count is there only for a contract with several lots, and award_lots_counted only when the amount adds up just some of them; neither means one award for the whole contract) and received_bids (the highest count of one lot when received_bids_is_highest_lot). With include_holders each item has holders: how many, and the name and url of the company when there is exactly one (a person's name is masked); lookups are limited per account (30 pages a minute, 120 an hour) and a page over the budget comes without them (holders_note). Pages of up to 50: while the result has a next_cursor, pass it as cursor (same other arguments). Facts only: Licto draws no conclusion from them.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "search_expiring_contracts"
  }
}

Input Schema

NameRequiredDescriptionDefault
qNoWords of the contract title, 3 to 80 characters and at most 8 words: every word must be present; accents, capitals and plurals are ignored. The list keeps its order (estimated end), never relevance, and `coverage` is absent. Available only while Licto's title search is open to the caller.
cpvNoOne CPV code of 2-8 digits: the contract's main CPV is that code or one under it (a 2-digit division, a longer prefix or a full code).
limitNoPage size
cursorNoPaging: the `next_cursor` of the previous page. Keep every other argument the same.
sectorNoLicto sector slug from list_sectors, e.g. 'tecnologia' or 'construccion'; 'otros' is the catch-all sector.
comunidadNoComunidad autónoma of the place of performance by name, e.g. 'Andalucía' or 'Madrid'. For a province use `provincia`.
provinciaNoProvincia of the place of performance by name, e.g. 'Sevilla' or 'Bizkaia'; accents and case are ignored. Give one of `comunidad` and `provincia`, not both. The islands of Canarias and Illes Balears are filtered by `comunidad`.
company_idNoInstead of the national list, the contracts this company holds (id from search_companies), as the company page's «Contratos con fin estimado» block. Only `horizon_months`, `cursor` and `limit` combine with it. Without a plan that includes the full list (Profesional and above) only the 3 nearest are returned.
max_amountNoMaximum tender budget in EUR, excluding IVA
min_amountNoMinimum tender budget in EUR, excluding IVA
horizon_monthsNoWindow of the list: contracts estimated to end within 3, 6, 9 or 12 months.
include_holdersNotrue = say who holds each contract of the page (national list and organismo only). Costs one unit of the account's holders budget per page; false skips it.
organization_idNoOnly the contracts of this organismo (id from search_organizations), the same list as the organismo page's «Contratos con fin estimado», with the filters above.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/5.0
Behavior5/5

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

Annotations only cover safety (readOnly, idempotent, non-destructive), yet the description adds substantial behavior beyond that: the end is an ESTIMATE from formalisation date plus stated duration, non-estimable notices are excluded and coverage must be quoted, holders lookups are rate-limited (30 pages/min, 120/hour) and dropped when over budget, and plan tiers truncate results. This is rich, non-obvious disclosure.

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

Conciseness3/5

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

Purpose is well front-loaded and the density is justified by 13 parameters and no output schema, but the whole definition is a single wall-of-text paragraph mixing return-value detail, filter semantics, and rate limits. Several clauses duplicate what the schema already documents, and the run-on structure hurts scanability.

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 no output schema, the description carries the full burden and does so thoroughly: it documents `total`, `by_month` (always 12 months, may exceed total), the `items` fields including award and bid caveats, `holders`/`holders_note`, and `coverage`. Nothing an agent needs to interpret or call the tool correctly is missing.

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 the schema already documents every parameter's meaning. The description mostly restates filter semantics (sector, cpv, min/max amount, q) that the schema already carries; its added value is limited to the `company_id` combination rule and the always-12 `by_month` caveat, which are partly duplicated in the schema.

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 first sentence states a specific verb and resource ('Public contracts that MAY END SOON') and precisely defines the population: awarded competitive contracts whose estimated end falls within `horizon_months`. It also distinguishes this from a generic contract listing by naming the estimability condition and the 'who is likely to tender next' framing.

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?

It gives concrete routing guidance: `sector` points to list_sectors, `company_id` switches to a company's contracts 'instead of the national list', and `organization_id` mirrors the organismo page. It lacks an explicit when-not/alternative-tool statement (e.g., versus search_tenders), which keeps it short of a 5.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources