Contents
Documentation Town hall profile
town-hall-profile
1 credit per call Read-only mairies
Get the profile of one French commune by sections: town hall contacts, mayor and deputy mayors with their portfolios, web presence, finances, elections, facilities, summary.
When to use it. Give the INSEE code when known, otherwise the commune name, with the department code if the name is common. If several communes match, the error lists them with their INSEE codes: call again with one. Ask only for the sections the question needs (default: contacts and officials; 'all' for everything): shorter answers. 'summary' gives recent State-funded projects, permits and contracts to renew.
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:
Use Mairies de France to get the profile of one French commune by sections: town hall contacts, mayor and deputy mayors with their portfolios, web presence, finances, elections, facilities, summary.
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.
{
"mcpServers": {
"mairies-de-france": {
"url": "https://mairies.vosfichiers.com/mcp"
}
}
}
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "town-hall-profile",
"arguments": {
"insee": "38229",
"sections": [
"contacts",
"officials"
]
}
}
}
Put an API key in the API_KEY environment variable first. Create a key
curl -X POST https://mairies.vosfichiers.com/api/v1/town-hall-profile \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"insee": "38229",
"sections": [
"contacts",
"officials"
]
}'
Put an API key in the API_KEY environment variable first. Create a key
import json
import os
import urllib.request
payload = {
"insee": "38229",
"sections": [
"contacts",
"officials",
],
}
request = urllib.request.Request(
"https://mairies.vosfichiers.com/api/v1/town-hall-profile",
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
const response = await fetch("https://mairies.vosfichiers.com/api/v1/town-hall-profile", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"insee": "38229",
"sections": [
"contacts",
"officials"
]
}),
});
console.log(await response.json());
Input
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| insee | string | optional | none | INSEE code of the commune, e.g. 38229. pattern ^(\d{5}|2[AB]\d{3})$ |
| name | string | optional | none | Commune name, e.g. Meylan. Ignored when insee is given. 2 to 80 characters |
| department | string | optional | none | Department code, to tell apart communes with the same name. pattern ^(\d{2}|2A|2B|97\d)$ |
| sections | array of enum | optional | ["contacts", "officials"] | Sections to return besides the identity; 'all' for every section. at most 8 itemseach item: one of "contacts", "officials", "web", "finances", "elections", "facilities", "summary", "all" |
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 1 credit.
Open in the playground