Skip to main content
Glama

Buscar licitaciones

search_tenders
Read-onlyIdempotent

Search Spanish public procurement tenders (licitaciones) with full-text query and filters (place by comunidad or provincia, CPV, budget, dates, procedure and contract type, framework, EU threshold) and a choice of sort order (e.g. sort=budget_desc for the largest). Returns compact rows with licto.es links and, per tender, its source (source, the record's source_url and source_updated_at); the response's sources block, once per source, gives the publisher, licence and attribution text to cite, with provenance_notice. Amounts: budget_eur is the presupuesto base de licitación excluding IVA, as the source publishes it (a source that publishes only a VAT-inclusive figure gives that one); estimated_total_eur is the valor estimado del contrato (excluding IVA, with options and extensions) when the notice states it. min_budget/max_budget filter budget_eur. publication_date is absent when the source published none (Licto then holds only a stand-in, the award or formalization date, which is not when the tender was published); published_after leaves such tenders out, so with it total can count tenders that never reach the pages, and a page can be shorter than limit while next_cursor still leads to more. cpv: a 2-digit division, a 3-7 digit prefix or a full 8-digit code, each matching its descendants; several codes comma-separated (up to 10), any of them matches. query: plain words, every word must match (no OR, no phrases); run separate searches for alternatives. comunidad / provincia filter by the NUTS region recorded in the notice. Tenders recorded only as nationwide ('España', typical of national bodies) are listed under every comunidad; one whose notice records another region, or none, can be missed, so complement the filter with a query naming the place. An awarded tender's row adds winner, winner_company_id, award_amount_eur (the award of the whole tender, absent when the source states none; get_tender gives it per lot), received_bids and award_date; a tender with no award has none of them. To list the tenders a company won (one row per tender; one row per awarded lot is get_company_awards): find its id with search_companies, then call search_tenders(company_id=...); awarded_after / awarded_before bound the award date (only with company_id). In that mode the rows come from the award data, not the text index: query and sort=relevance are refused, every other filter applies (status, comunidad / provincia, cpv, budgets, deadline_*, published_after, organization_id, procedure_type, contract_type, is_framework, over_threshold, sort), winner is that company, award_amount_eur is what it was awarded (a multi-lot tender may have other winners: see get_tender) and total stops counting at 10000. Pages of up to 50: while the result has a next_cursor, pass it as cursor (same other arguments) for the next page; total is the estimated number of matches.

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_tenders"
  }
}

Input Schema

NameRequiredDescriptionDefault
cpvNoCPV filter: a 2-digit division ('45'), a 3-7 digit prefix ('4523' = that group and everything under it) or a full 8-digit code (that code and its descendants; the trailing zeros of '45000000' are its level, so it is division 45). Several codes comma-separated, any of them matches, up to 10: '302,48'.
sortNoOrder of the results. `relevance` = text ranking of `query`; `deadline_asc` lists only tenders whose deadline is today or later.publication_date_desc
limitNoPage size
queryNoFull-text query, Spanish works best. Not available with `company_id`.
cursorNoPaging: the `next_cursor` of the previous page. Keep every other argument the same.
statusNoaccepting = open for bids; evaluating = bids under evaluation; awarded = awarded/executing/completed. Each result row (and get_tender) carries `status_group` with these same values; `status` keeps the raw internal status.
comunidadNoComunidad autónoma by name, e.g. 'Andalucía', 'Madrid' or 'Comunitat Valenciana'. For a province use `provincia` instead.
provinciaNoProvincia by name, e.g. 'Sevilla', 'Bizkaia' or 'Las Palmas'; accents and case are ignored. Narrower than `comunidad`: give one of the two, not both.
company_idNoRestrict to tenders this company won (id from search_companies): the way to list a company's contracts. Cannot be combined with `query` or sort=relevance.
max_budgetNoMaximum budget in EUR
min_budgetNoMinimum budget in EUR
is_frameworkNotrue = only framework agreements (acuerdos marco); false = exclude them
awarded_afterNoAward date on/after (ISO), for the date the tender was awarded. Requires `company_id`.
contract_typeNoContract types, any of: services, supplies, works, concession, other, admin_special, private, public_service_mgmt, concession_services, concession_works, ppp, patrimonial
awarded_beforeNoAward date on/before (ISO), for the date the tender was awarded. Requires `company_id`.
deadline_afterNoSubmission deadline on/after (ISO)
over_thresholdNotrue = only tenders above the EU (SARA) threshold; false = leave them out
procedure_typeNoProcedure types, any of: open, restricted, negotiated, competitive_dialogue, open_simplified, innovation_partnership, framework_based, dps_based, design_contest, innovation_derived, competitive_with_negotiation, negotiated_with_pub, negotiated_without_pub, internal_rules, other
deadline_beforeNoSubmission deadline on/before (ISO)
organization_idNoRestrict to tenders published by this organization (id from search_organizations)
published_afterNoPublication date on/after (ISO) — use for 'what's new since X'. Tenders whose source published no date (Licto holds a stand-in, see `publication_date`) are left out.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare a safe, idempotent read, yet the description adds substantial behavior beyond them: the company_id mode draws from award data rather than the text index and caps total at 10000; published_after drops stand-in-dated tenders so total can exceed what pages show and a page may be shorter than limit while next_cursor continues. It also discloses the query grammar (no OR, no phrases) and the comunidad nationwide-listing caveat — real operational limits an agent would otherwise hit blindly.

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?

Purpose and the primary workflow are front-loaded, and nearly every sentence carries a distinct caveat that affects correctness. The cost is structure: it is one very long paragraph mixing return shape, field definitions, filter semantics, and paging, which makes it harder to scan than a short bulleted layout would be.

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 21 optional parameters and no output schema, the description carries the return-value burden itself and does: compact rows with licto.es links, per-tender source fields, the sources block with licence and attribution, the budget field definitions, and the extra awarded fields (winner, award_amount_eur, received_bids, award_date) with the note that non-awarded tenders lack them. Paging via next_cursor/cursor is spelled out. Nothing essential to a correct call is missing.

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 coverage is 100%, so 3 is the baseline, but the description adds meaning the schema does not: min_budget/max_budget are tied explicitly to budget_eur, budget_eur is defined as presupuesto base de licitación excluding IVA while estimated_total_eur is valor estimado, and awarded_after/awarded_before are noted as valid only with company_id (schema says 'Requires company_id' but the description ties it to the mode). It does not cover every one of the 21 parameters (e.g. status_group nuance is left to the schema), so not a 5.

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 states a specific verb and resource — 'Search Spanish public procurement tenders (licitaciones)' — plus the scope of query and filters. It goes further and differentiates siblings by name: get_tender for per-lot awards, get_company_awards for one row per awarded lot, search_companies for the id. An agent can route correctly without opening another schema.

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

Usage Guidelines5/5

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

Explicit when-to-use routing: 'To list the tenders a company won ... find its id with search_companies, then call search_tenders(company_id=...)' and 'one row per awarded lot is get_company_awards'. It also states exclusions for that mode ('query and sort=relevance are refused') and advises complementing a comunidad filter with a place-naming query. Alternatives and conditions are both present.

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