Contents

Documentation Contract renewals search

contract-renewals-search

2 credits per call Read-only mairies

Find recurring public contracts of French communes (services, supplies) that will probably be tendered again within a few months, by theme, words, department or size.

When to use it. E.g. school catering contracts ending within 18 months in department 69: words 'restauration scolaire', within_months 18, department 69. Results are sorted by probable end date and give the current supplier, the amount and the town hall contacts.

Credits are taken when the call starts and given back in full if the tool fails, times out or is refused by the service behind it.

Ask your assistant

Once the server is connected, a request in plain words is enough. For example:

Example request
Use Mairies de France to find recurring public contracts of French communes (services, supplies) that will probably be tendered again within a few months, by theme, words, department or size.

Examples

Most clients only need the server address and a sign-in: see Connect. Clients configured by a file take the first block. Your assistant then writes the second one by itself.

Client configuration
{
  "mcpServers": {
    "mairies-de-france": {
      "url": "https://mairies.vosfichiers.com/mcp"
    }
  }
}
What the assistant sends
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "contract-renewals-search",
    "arguments": {
      "limit": 10,
      "offset": 0,
      "within_months": 24
    }
  }
}

Put an API key in the API_KEY environment variable first. Create a key

bash
curl -X POST https://mairies.vosfichiers.com/api/v1/contract-renewals-search \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "limit": 10,
  "offset": 0,
  "within_months": 24
}'

Put an API key in the API_KEY environment variable first. Create a key

python
import json
import os
import urllib.request

payload = {
    "limit": 10,
    "offset": 0,
    "within_months": 24,
}
request = urllib.request.Request(
    "https://mairies.vosfichiers.com/api/v1/contract-renewals-search",
    data=json.dumps(payload).encode(),
    headers={
        "Authorization": "Bearer " + os.environ["API_KEY"],
        "Content-Type": "application/json",
    },
    method="POST",
)
with urllib.request.urlopen(request) as response:
    print(json.load(response))

Put an API key in the API_KEY environment variable first. Create a key

javascript
const response = await fetch("https://mairies.vosfichiers.com/api/v1/contract-renewals-search", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "limit": 10,
    "offset": 0,
    "within_months": 24
  }),
});
console.log(await response.json());

Input

Fields this tool accepts
Field Type Required Default Description
limit integer optional 10 Rows per page, 25 at most. ≥ 1≤ 25
offset integer optional 0 Rows to skip, for the next page. ≥ 0≤ 50000
department string optional none Department code, e.g. 38, 2A or 974. pattern ^(\d{2}|2A|2B|97\d)$
name string optional none Part of the commune name. 2 to 80 characters
population_min integer optional none Minimum population. ≥ 0
population_max integer optional none Maximum population. ≥ 0
profile string optional none Keep only communes with this profile: rurale, montagne, touristique, qpv, petites-villes-de-demain, villages-d-avenir. pattern ^(rurale|montagne|touristique|qpv|petites-villes-de-demain|villages-d-avenir)$
has_website boolean optional none True: only communes with a website.
theme enum optional none Theme of the contract. one of "schools-childhood", "public-buildings", "energy", "street-lighting", "roads-mobility", "water-sanitation", "environment-nature", "sport", "culture-heritage", "health-social", "security", "digital", "planning-urbanism", "economy-tourism", "general-services"
words string optional none Words. 3 to 80 characters
within_months integer optional 24 Probable end within. ≥ 3≤ 36
min_amount integer optional none Minimum amount in euros. ≥ 0

Output

A JSON object whose fields depend on the request; this tool declares no fixed shape.

Try it

Run this tool from your account, with a form built from the fields above. A run is a real call: it costs 2 credits.

Open in the playground