{"openapi":"3.1.0","info":{"title":"Portal da Transparencia (BYOK) API","version":"0.1.0","description":"Portal da Transparencia (BYOK) lets an AI assistant read your own Portal da Transparencia data through the Portal da Transparencia API with a key you supply (Portal da Transparencia API key). Read-only: 12 tools (list_siafi_agencies, list_siape_agencies, search_contracts, get_contract, search_bids, get_bid, search_agreements, get_agreement, get_spending_by_agency, search_parliamentary_amendments,...\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://byok-portal-transparencia.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/byok-portal-transparencia/docs"},"termsOfService":"https://connectorbay.com/byok-portal-transparencia/terms"},"servers":[{"url":"https://byok-portal-transparencia.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/byok-portal-transparencia/docs"},"security":[{"upstreamKey":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Optional. A Pro API key raises rate limits; no credentials are required."},"upstreamKey":{"type":"apiKey","in":"header","name":"X-Upstream-Key","description":"Your own key for the service this connector wraps (bring your own key). Used for that one call only; never stored, logged or cached."}},"schemas":{"Error":{"type":"object","properties":{"ok":{"const":false},"error":{"type":"object"}}}}},"paths":{"/v1/tools/list_siafi_agencies":{"post":{"operationId":"list_siafi_agencies","summary":"List federal agencies registered in SIAFI with their codes, optionally filtered by code or name; the codes are needed by","description":"List federal agencies registered in SIAFI with their codes, optionally filtered by code or name; the codes are needed by the contract, bid and spending tools. The portal's documentation does not list response fields, so the full answer is returned (trimmed to fit); field names are in Portuguese. Use for \"What is the SIAFI code of the Ministry of Health\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"code":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}],"default":null,"description":"SIAFI agency code.","title":"Code"},"name":{"anyOf":[{"maxLength":120,"type":"string"},{"type":"null"}],"default":null,"description":"Agency name text.","title":"Name"},"page":{"anyOf":[{"maximum":100000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"}},"title":"list_siafi_agenciesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_siape_agencies":{"post":{"operationId":"list_siape_agencies","summary":"List federal agencies registered in SIAPE (the civil-service payroll system) with their codes, optionally filtered by co","description":"List federal agencies registered in SIAPE (the civil-service payroll system) with their codes, optionally filtered by code or name. The portal's documentation does not list response fields, so the full answer is returned (trimmed to fit); field names are in Portuguese. Use for \"Which SIAPE agencies have 'Educacao' in their name\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"code":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}],"default":null,"description":"SIAPE agency code.","title":"Code"},"name":{"anyOf":[{"maxLength":120,"type":"string"},{"type":"null"}],"default":null,"description":"Agency name text.","title":"Name"},"page":{"anyOf":[{"maximum":100000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"}},"title":"list_siape_agenciesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/search_contracts":{"post":{"operationId":"search_contracts","summary":"List federal executive contracts for one agency, optionally limited to contracts whose term falls in a date range. The p","description":"List federal executive contracts for one agency, optionally limited to contracts whose term falls in a date range. The portal's documentation does not list response fields, so the full answer is returned (trimmed to fit); field names are in Portuguese. Use for \"Which contracts does agency 26000 have\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"agency_code":{"description":"Agency code in the federal accounting system SIAFI (find it with list_siafi_agencies).","maxLength":20,"title":"Agency Code","type":"string"},"start_date":{"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}],"default":null,"description":"Term start. Date as DD/MM/YYYY.","title":"Start Date"},"end_date":{"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}],"default":null,"description":"Term end. Date as DD/MM/YYYY.","title":"End Date"},"page":{"anyOf":[{"maximum":100000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"}},"required":["agency_code"],"title":"search_contractsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_contract":{"post":{"operationId":"get_contract","summary":"Get one federal contract by its portal id. The portal's documentation does not list response fields, so the full answer ","description":"Get one federal contract by its portal id. The portal's documentation does not list response fields, so the full answer is returned (trimmed to fit); field names are in Portuguese. Use for \"Show federal contract 12345\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"contract_id":{"description":"Portal contract id.","maximum":2000000000,"minimum":1,"title":"Contract Id","type":"integer"}},"required":["contract_id"],"title":"get_contractArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/search_bids":{"post":{"operationId":"search_bids","summary":"List federal procurement bids (licitacoes) for one agency, optionally by opening date; the portal asks for a period of a","description":"List federal procurement bids (licitacoes) for one agency, optionally by opening date; the portal asks for a period of at most one month. The portal's documentation does not list response fields, so the full answer is returned (trimmed to fit); field names are in Portuguese. Use for \"Which bids did agency 26000 open in March 2026\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"agency_code":{"description":"Agency code in the federal accounting system SIAFI (find it with list_siafi_agencies).","maxLength":20,"title":"Agency Code","type":"string"},"start_date":{"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}],"default":null,"description":"Opening date from. Date as DD/MM/YYYY.","title":"Start Date"},"end_date":{"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}],"default":null,"description":"Opening date to. Date as DD/MM/YYYY.","title":"End Date"},"page":{"anyOf":[{"maximum":100000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"}},"required":["agency_code"],"title":"search_bidsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_bid":{"post":{"operationId":"get_bid","summary":"Get one federal procurement bid by its portal id. The portal's documentation does not list response fields, so the full ","description":"Get one federal procurement bid by its portal id. The portal's documentation does not list response fields, so the full answer is returned (trimmed to fit); field names are in Portuguese. Use for \"Show federal bid 54321\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"bid_id":{"description":"Portal bid id.","maximum":2000000000,"minimum":1,"title":"Bid Id","type":"integer"}},"required":["bid_id"],"title":"get_bidArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/search_agreements":{"post":{"operationId":"search_agreements","summary":"List federal agreements (convenios) with filters for reference dates, recipient, agency, state, municipality and status;","description":"List federal agreements (convenios) with filters for reference dates, recipient, agency, state, municipality and status; the portal asks for a reference period of at most one day when dates are used. The portal's documentation does not list response fields, so the full answer is returned (trimmed to fit); field names are in Portuguese. Use for \"Which federal agreements are with the state of Bahia\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"start_date":{"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}],"default":null,"description":"Reference date from. Date as DD/MM/YYYY.","title":"Start Date"},"end_date":{"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}],"default":null,"description":"Reference date to. Date as DD/MM/YYYY.","title":"End Date"},"recipient":{"anyOf":[{"maxLength":120,"type":"string"},{"type":"null"}],"default":null,"description":"Name of the recipient entity (convenente).","title":"Recipient"},"agency_code":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}],"default":null,"description":"Agency code in the federal accounting system SIAFI (find it with list_siafi_agencies).","title":"Agency Code"},"state":{"anyOf":[{"maxLength":2,"type":"string"},{"type":"null"}],"default":null,"description":"Two-letter state abbreviation.","title":"State"},"municipality_ibge":{"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}],"default":null,"description":"Municipality IBGE code.","title":"Municipality Ibge"},"status_code":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}],"default":null,"description":"Agreement status code.","title":"Status Code"},"page":{"anyOf":[{"maximum":100000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"}},"title":"search_agreementsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_agreement":{"post":{"operationId":"get_agreement","summary":"Get one federal agreement (convenio) by its portal id. The portal's documentation does not list response fields, so the ","description":"Get one federal agreement (convenio) by its portal id. The portal's documentation does not list response fields, so the full answer is returned (trimmed to fit); field names are in Portuguese. Use for \"Show federal agreement 777\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"agreement_id":{"description":"Portal agreement id.","maximum":2000000000,"minimum":1,"title":"Agreement Id","type":"integer"}},"required":["agreement_id"],"title":"get_agreementArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_spending_by_agency":{"post":{"operationId":"get_spending_by_agency","summary":"Get federal spending per agency for a year, optionally for one top-level agency or one entity (SIAFI codes). The portal'","description":"Get federal spending per agency for a year, optionally for one top-level agency or one entity (SIAFI codes). The portal's documentation does not list response fields, so the full answer is returned (trimmed to fit); field names are in Portuguese. Use for \"How much did each federal agency spend in 2025\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"year":{"description":"Budget year (YYYY).","maximum":2100,"minimum":1990,"title":"Year","type":"integer"},"top_agency_code":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}],"default":null,"description":"Top-level agency SIAFI code.","title":"Top Agency Code"},"agency_code":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}],"default":null,"description":"Agency code in the federal accounting system SIAFI (find it with list_siafi_agencies).","title":"Agency Code"},"page":{"anyOf":[{"maximum":100000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"}},"required":["year"],"title":"get_spending_by_agencyArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/search_parliamentary_amendments":{"post":{"operationId":"search_parliamentary_amendments","summary":"List federal budget amendments proposed by members of congress, filtered by year, author, amendment code or number, func","description":"List federal budget amendments proposed by members of congress, filtered by year, author, amendment code or number, function and sub-function. The portal's documentation does not list response fields, so the full answer is returned (trimmed to fit); field names are in Portuguese. Use for \"Which budget amendments did a given deputy author in 2025\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"year":{"anyOf":[{"maximum":2100,"minimum":1990,"type":"integer"},{"type":"null"}],"default":null,"description":"Year (YYYY).","title":"Year"},"author":{"anyOf":[{"maxLength":120,"type":"string"},{"type":"null"}],"default":null,"description":"Author name.","title":"Author"},"amendment_code":{"anyOf":[{"maxLength":30,"type":"string"},{"type":"null"}],"default":null,"description":"Amendment code.","title":"Amendment Code"},"amendment_number":{"anyOf":[{"maxLength":30,"type":"string"},{"type":"null"}],"default":null,"description":"Amendment number.","title":"Amendment Number"},"amendment_type":{"anyOf":[{"maxLength":60,"type":"string"},{"type":"null"}],"default":null,"description":"Amendment type.","title":"Amendment Type"},"function_code":{"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}],"default":null,"description":"Budget function code.","title":"Function Code"},"subfunction_code":{"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}],"default":null,"description":"Budget sub-function code.","title":"Subfunction Code"},"page":{"anyOf":[{"maximum":100000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"}},"title":"search_parliamentary_amendmentsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_company":{"post":{"operationId":"get_company","summary":"Look up the portal's record of a legal entity (company or public body) by CNPJ number. The portal's documentation does n","description":"Look up the portal's record of a legal entity (company or public body) by CNPJ number. The portal's documentation does not list response fields, so the full answer is returned (trimmed to fit); field names are in Portuguese. Use for \"What does the portal have on CNPJ 00394460000141\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"cnpj":{"description":"CNPJ number, digits only.","maxLength":18,"title":"Cnpj","type":"string"}},"required":["cnpj"],"title":"get_companyArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_federal_properties":{"post":{"operationId":"list_federal_properties","summary":"List federal real-estate properties filtered by managing agency, status, region, postcode or address text. The portal's ","description":"List federal real-estate properties filtered by managing agency, status, region, postcode or address text. The portal's documentation does not list response fields, so the full answer is returned (trimmed to fit); field names are in Portuguese. Use for \"Which federal properties are registered in postcode 70040-010\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"agency_code":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}],"default":null,"description":"Agency code in the federal accounting system SIAFI (find it with list_siafi_agencies).","title":"Agency Code"},"status":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}],"default":null,"description":"Property status code.","title":"Status"},"region":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"Region of the property.","title":"Region"},"postcode":{"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}],"default":null,"description":"CEP postcode.","title":"Postcode"},"address":{"anyOf":[{"maxLength":120,"type":"string"},{"type":"null"}],"default":null,"description":"Address text.","title":"Address"},"page":{"anyOf":[{"maximum":100000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"}},"title":"list_federal_propertiesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}}}}