Skip to main content
Glama

Morocco communes

Server Details

Morocco's régions, provinces and communes: HCP codes, names, census population and boundaries

If you are the author of this connector, you can claim ownership with GitHub, an HTTP challenge, or a DNS record. Claimed connector authors can inspect health checks, view analytics, and manage their listing.
Status
Healthy
Last Tested
Transport
Streamable HTTP · MCP 2025-11-25
URL
Repository
zkousama/morocco-communes
GitHub Stars
0

TDQS

A4.2/5.0

Scored across 9 tools

Disambiguation5/5

Each tool targets a distinct query type: point lookup, proximity search, commune details, higher-level unit details, name search, commune listing, and three separate HCP statistic domains (economy, housing, indicators). The potentially overlapping get_housing/get_indicators pair is explicitly differentiated by urban dwelling stock versus household-level census dwelling characteristics.

Naming Consistency4/5

Six tools follow a clear get_/list_ verb_noun pattern, and search is a conventional name lookup. commune_at and communes_near are useful spatial-query names but break the verb_noun convention, making the set mostly consistent rather than fully uniform.

Tool Count5/5

Nine tools fit the server's purpose well, covering the administrative hierarchy, commune lookup and spatial queries, name search, and three major census datasets without redundancy. This is within the ideal 3-15 range and each tool earns its place.

Completeness5/5

The tool surface supports the full read-only workflow: find units by name or point, retrieve commune/unit details, list/filter/sort communes, and pull economy, housing, and indicator statistics at any level. There are no obvious dead ends; search codes and parent/child links chain cleanly into the detail tools.

Available Tools

9 tools
commune_atCommune at a pointA
Read-onlyIdempotent
Inspect

The commune whose boundary contains a point, with its names, type, parents and population, and in Casablanca, Rabat, Fès, Marrakech, Salé and Tanger the arrondissement too. Use it to turn coordinates, from a map or a device, into a commune. Sidi Mohamed Benmansour has no boundary, and neither do about 88 km² between Ifrane and Boulemane.

ParametersJSON Schema
NameRequiredDescriptionDefault
latYesLatitude, in degrees.
lngYesLongitude, in degrees.

Output Schema

ParametersJSON Schema
NameRequiredDescription
communeYes
arrondissementYes

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and idempotentHint, so the description doesn't need to restate safety. It adds valuable behavioral context: the specific cities where arrondissements are included, and the known coverage gaps. This goes beyond the schema and helps an agent predict failures.

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?

The description is three sentences: the first defines purpose and output, the second gives a usage directive, and the third notes exceptions. It is efficient and front-loaded with the core definition. The third sentence is a useful aside but slightly tangential, so it isn't perfectly lean.

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?

For a simple read-only tool with two well-documented parameters and an existing output schema, the description covers everything an agent needs: core function, intended use, and known data gaps. The mention of specific cities and exceptions makes it exceptionally complete.

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?

Both parameters (lat, lng) are fully described in the schema with ranges and units ('Latitude, in degrees.'). The description only adds the generic term 'coordinates' and does not provide additional format details, bounds, or examples. With 100% schema coverage, the baseline of 3 is appropriate.

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 description clearly states the tool returns the commune containing a point, with specific fields (names, type, parents, population) and even city-specific arrondissements. It also distinguishes from siblings like communes_near and get_commune by focusing on point-to-commune mapping.

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 an explicit use case: 'Use it to turn coordinates, from a map or a device, into a commune.' It also highlights known edge cases where no commune exists (Sidi Mohamed Benmansour, 88 km² between Ifrane and Boulemane), which is useful for setting expectations. However, it does not explicitly contrast with alternatives like communes_near, so it misses the 'when-not-to-use' guidance.

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

communes_nearCommunes near a pointA
Read-onlyIdempotent
Inspect

Communes within a radius of a point, nearest first. Distance is measured to each commune's centroid, so the nearest commune isn't always the one that contains the point: commune_at gives that one.

ParametersJSON Schema
NameRequiredDescriptionDefault
latYesLatitude, in degrees.
lngYesLongitude, in degrees.
limitNoHow many results. 10 when left out, at most 50.
radius_kmNoRadius in km. 10 when left out, at most 100.

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultsYes

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true, so the safety profile is covered. The description adds valuable behavioral context: distance is measured to centroids, results are ordered nearest-first, and the nearest commune may not contain the point. This goes beyond the annotations and helps the agent interpret results correctly.

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

Conciseness5/5

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

Two sentences with no wasted words. The core behavior is front-loaded, and the caveat plus sibling alternative is packed into the second sentence. Every clause earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has an output schema, so return values are documented elsewhere. The description covers the key behavioral nuance (centroid distance) and the sibling distinction. A small gap is that it doesn't mention the default radius/limit, but those are already in the input schema, so the description is complete enough for an agent to call it correctly.

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 all four parameters (lat, lng, limit, radius_km) with types, bounds, and defaults. The description adds the centroid-distance semantics but doesn't need to repeat parameter details. Baseline 3 is appropriate because the schema carries the parameter documentation burden.

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 description states a specific verb ('Communes within a radius of a point') and resource, and explicitly distinguishes itself from the sibling commune_at by explaining the centroid-distance behavior. This makes the tool's purpose unmistakable and differentiates it from the sibling that returns the commune containing the point.

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?

The description explicitly says when to use this tool versus commune_at: use this for communes within a radius, and commune_at for the commune that contains the point. It also clarifies the nearest-first ordering and the centroid caveat, which is essential for correct selection.

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

get_communeGet one communeB
Read-onlyIdempotent
Inspect

One commune's names, type, région, province and cercle, 2024 and 2014 population, the change between them, a point inside it, the communes it borders and how much boundary it shares with each, and in the 6 cities divided into them, its arrondissements with their population. Identify it by HCP code (01.511.01.0), the code as digits, or a slug (tanger).

ParametersJSON Schema
NameRequiredDescriptionDefault
idYesAn HCP code, the code as digits, or a slug.

Output Schema

ParametersJSON Schema
NameRequiredDescription
communeYes
neighboursYesThe communes this one borders, longest shared boundary first. Measured on the OpenStreetMap boundaries, so it is under ODbL.
arrondissementsYesCasablanca, Rabat, Fès, Marrakech, Salé and Tanger's arrondissements, most populous first; empty elsewhere.

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true, covering the safety profile. The description adds context about accepted ID formats and the scope of returned data, but it does not disclose error behavior, rate limits, or dependency on external factors. This is adequate but not beyond what annotations provide.

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?

The description is a single dense sentence enumerating all the returned data, followed by a clear identifier instruction. Every phrase adds information, and it is front-loaded with the core content. It is long but not verbose, though it could be broken into two sentences for easier scanning.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given an output schema exists and annotations cover read-only/idempotent behavior, the description is sufficient for an agent to know what it returns and how to call it. It does not mention failure modes or edge cases (e.g., codes not found), but the presence of an output schema fills in the return structure. Overall, the description is complete enough for correct invocation in the common case.

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% with a short description of the 'id' parameter. The tool description adds concrete examples ('01.511.01.0' and 'tanger') that clarify the accepted formats, providing extra value beyond the schema's generic wording. This nudges it above the baseline 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool returns a wide array of data for a single commune (names, type, populations, borders, arrondissements), and specifies the identifier types. It is unambiguous about the resource and scope, but it does not explicitly name sibling tools or contrast with them, so it falls short of a 5.

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

Usage Guidelines2/5

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

The description explains how to identify the commune (HCP code, digits, or slug) but gives no guidance on when to use this tool versus alternatives like list_communes, commune_at, or get_unit. There is no mention of use cases, prerequisites, or exclusions, so the agent is left to infer situational appropriateness from the name alone.

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

get_economyEconomic establishmentsA
Read-onlyIdempotent
Inspect

HCP's 2024 count of economic establishments for Morocco or any région, province or préfecture, cercle, commune or arrondissement: how many establishments were mapped, how many are public services, how many are associations in premises of their own, how many are businesses, and how many permanent jobs those businesses hold. The businesses are split three ways, each covering all of them: by sector (industry, construction, commerce, services), by how many people work there (1, 2-3, 4-9, 10-49, 50 and over), and by when they were founded (before 1956 through 2020 and later). The weekly souks in use are counted beside them and are not part of the total.

Reading them: every figure is a count, taken during the census by field teams who mapped each establishment. Farming is out, the workbook counts every sector but agriculture, and the jobs are the permanent ones.

Ranking and comparing: to order communes by one of these, call list_communes with sort set to its path, such as economy.establishments.jobs, or by one of the 3 it works out from them: economy.per1000.establishments, economy.per1000.jobs, economy.perBusiness.jobs. To compare the régions, the provinces or the arrondissements, give level without a unit and get them all in one call.

Casablanca and the 5 other cities divided into arrondissements are counted by arrondissement, so their figures are the sum of those, marked basis: arrondissement_sum. Say so when you report one.

ParametersJSON Schema
NameRequiredDescriptionDefault
unitNoA région, province or préfecture, cercle, commune or arrondissement, by code or slug. Morocco as a whole when left out.
levelNoWith a unit, the level it's at, where a name is shared: Tiznit is a commune and a province, and a name alone means the commune. Without a unit, region, province or arrondissement gives every one of that level in one call.
topicsNoOnly these topics. Every topic when left out.

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultsYes

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the readOnly and idempotent annotations, the description discloses important behaviors: souks are counted separately and excluded from the total, agriculture is excluded, jobs are permanent, and cities with arrondissements are reported as arrondissement sums with basis: arrondissement_sum. These are exactly the non-obvious behaviors an agent needs before invoking the tool.

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

Conciseness5/5

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

The description is long but every section earns its place: a clear inventory of counts, a 'Reading them' caveat block, a 'Ranking and comparing' routing block, and a specific arrondissement_sum warning. It is front-loaded with the core count definition and uses compact, structured paragraphs rather than repetition.

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?

For a read-only data retrieval tool with an output schema, the description covers all necessary context: granularity, exclusions, parameter behavior, comparison usage, and output semantics for arrondissement cities. An agent has enough information to select the tool, call it correctly, and interpret the result.

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%, but the description still adds meaning: it explains that a bare name defaults to the commune (e.g., Tiznit), that level without a unit returns every unit of that level, and that business splits correspond to sector, size, and founding period. This exceeds the baseline for fully covered 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 description opens with a precise verb and resource: 'HCP's 2024 count of economic establishments for Morocco or any région, province or préfecture, cercle, commune or arrondissement.' It names the exact metrics returned (establishments, public services, associations, businesses, permanent jobs) and clearly separates this from siblings like get_housing and list_communes.

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?

The description gives explicit routing guidance: 'To order communes by one of these, call list_communes with sort set to its path' and 'To compare the régions, the provinces or the arrondissements, give level without a unit and get them all in one call.' This tells the agent when to use an alternative tool and when to use this tool differently.

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

get_housingUrban housing stockA
Read-onlyIdempotent
Inspect

HCP's 2024 count of urban dwellings for Morocco or any unit that has an urban area: how many there are, how many are occupied, vacant or second homes, what kind they are (villa, apartment, traditional or modern Moroccan house, slum, rural-type), how old they are, what their walls and roofs are made of, how many are on the public electricity, water and sewerage networks, and HCP's housing shortfall. Every figure but the count is a percentage of that unit's urban dwellings. This counts dwellings, not households: a vacant flat is here and in nobody's census record, and get_indicators describes the dwelling each household lives in, for the whole country rather than the towns. A unit with no urban area has nothing here.

ParametersJSON Schema
NameRequiredDescriptionDefault
unitNoA unit by code or slug. Morocco as a whole when left out.
levelNoWith a unit, the level it's at. Without one, region, province or arrondissement gives every one of that level.
topicsNoOnly these topics. Every topic when left out.

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultsYes

TDQS

A4.9/5.0
Behavior5/5

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

The annotations already mark the tool as read-only and idempotent, and the description adds valuable behavioral context beyond that: it explains that every figure except the count is a percentage of the unit's urban dwellings, that vacant dwellings are included even though they appear in no census household record, and that units without urban areas return nothing. No contradiction with annotations exists.

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

Conciseness5/5

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

The description is long but every sentence carries essential information: the first sentence front-loads the full scope and metric list, the second clarifies percentage semantics, the third removes ambiguity about dwellings versus households and points to the sibling, and the fourth gives the no-data edge case. There is no filler or redundancy.

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?

The description, combined with the complete schema, annotations, and output schema, fully equips an agent to call this tool correctly. It explains the data source, unit eligibility, metric semantics, sibling differentiation, and edge-case behavior, so no critical information is missing for selection or invocation.

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?

The schema already covers 100% of parameters with descriptions and enums, so the baseline is 3. The description adds meaningful parameter-level context by clarifying what 'unit' means here (must have an urban area) and by explaining that all values except the count are percentages of that unit's urban dwellings. This goes beyond the schema's syntactic descriptions.

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 description states a specific resource (HCP 2024 urban dwellings), scope (Morocco or units with an urban area), and the concrete metrics returned (counts, occupancy, type, age, materials, networks, shortfall). It explicitly distinguishes itself from get_indicators by clarifying that it counts dwellings, not households, which prevents sibling confusion.

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?

It names the closest sibling, get_indicators, and explains the key difference: this tool counts dwellings while get_indicators describes the dwelling each household lives in. It also states a clear exclusion boundary: 'A unit with no urban area has nothing here,' telling the agent when not to expect results.

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

get_indicatorsCensus indicatorsA
Read-onlyIdempotent
Inspect

HCP's census figures for Morocco or any région, province or préfecture, cercle, commune or arrondissement: age, marital status, fertility, disability, schooling, illiteracy, the languages people read and write and the local languages they use, education, work, employment status and how people get to work, and for households their size, dwelling, occupancy, amenities, wastewater, waste and cooking fuel.

Reading them: shares and rates are percentages from 0 to 100. Null means HCP publishes no figure there. Most come from the long questionnaire, which went to a random 20% of households in communes of 2,000 households or more, so there they're estimates.

Ranking and comparing: to order communes by one figure, call list_communes with sort set to its path. To compare the régions, the provinces or the arrondissements, give level without a unit and get them all in one call.

The 2014 census is here too, under census. Age, education, local languages, illiteracy, fertility, disability, work, the ways of getting to work, dwellings, amenities, wastewater and waste ask what 2024 asks and can be read against it. Where people work and how children get to school are 2014 only. Five topics changed and can't be subtracted: marital status covered everyone rather than people aged 15 and over, schooling ages 7 to 12 rather than 6 to 11, reading and writing was asked as combinations of languages rather than one at a time, a household counted under every cooking fuel it used, and the employment shares took in unemployed people who had worked before. A unit the 2014 census didn't count has null there, Casablanca and the 5 other cities with arrondissements among them, since 2014 published those by arrondissement.

ParametersJSON Schema
NameRequiredDescriptionDefault
sexNoEveryone (all), men, women, or each of the three. all when left out. Household figures have no sex.
areaNoThe whole unit (total), its urban or rural part, or each of the three. total when left out.
unitNoA région, province or préfecture, cercle, commune or arrondissement, by code or slug. Morocco as a whole when left out.
levelNoWith a unit, the level it's at, where a name is shared: Tiznit is a commune and a province, and a name alone means the commune. Without a unit, region, province or arrondissement gives every one of that level in one call.
censusNoWhich census. 2024 when left out. both gives the two together, to see what changed.
topicsNoOnly these topics. Every topic when left out. Two are easy to confuse: labour holds the labour force, the activity rate and the unemployment rate, while employmentStatus is how the people in work are employed, as employees, self-employed or apprentices.

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultsYes

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already indicate read-only and idempotent hints, so the description builds on that by explaining the sampling methodology (20% long questionnaire) and the meaning of null values. It also discloses that some topics are estimates, adding important context beyond annotations.

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?

The description is long but packed with valuable information, and it is well-structured with clear sections. The first sentence lists the topics and scope, and subsequent paragraphs handle reading, ranking, and the 2014 comparison. No filler—every sentence adds critical detail, though it could be tightened slightly.

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?

Given the complexity of the tool with 6 optional parameters and an output schema, the description covers all necessary aspects: data sources, interpretation of percentages, sampling caveats, comparison methods, and cross-census compatibility. The output schema exists, so return values are not needed in the description. It is complete for an agent to use correctly.

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?

While schema coverage is 100% and parameters are well-described in the schema, the description adds crucial guidance for the topics parameter by explicitly distinguishing 'labour' from 'employmentStatus', reducing confusion. It also explains how unit and level interact for comparisons, which is not fully clear from the schema alone.

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 description clearly states the tool retrieves census indicators for Morocco and its administrative units, listing specific topics and the scope of data. It also differentiates from siblings by mentioning list_communes for ordering and comparing, and implies its role relative to other tools like get_commune and get_housing.

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?

The description explicitly explains how to rank communes (use list_communes with sort) and compare regions (give level without unit), providing clear when-to-use guidance. It also clarifies the census parameter for comparing 2014 and 2024, and notes topics that changed, preventing misinterpretation.

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

get_unitA région, province or cercleA
Read-onlyIdempotent
Inspect

One région, province, préfecture or cercle: its name in French and Arabic, its 2024 population and households, the units above it, how many units it holds, and the ones directly under it, named: a région's provinces, a province's cercles. This is the tool for a question about a unit above the commune, such as how many cercles a province has. For a commune or an arrondissement, call get_commune; to list a unit's communes, call list_communes with that unit.

ParametersJSON Schema
NameRequiredDescriptionDefault
unitYesA région, province, préfecture or cercle, by code or slug.
levelNoThe level, where a name is shared: Tiznit is a commune and a province, and a name alone means the commune.

Output Schema

ParametersJSON Schema
NameRequiredDescription
unitYes
countsYesHow many units of each level this one holds.
childrenYesThe units directly under it. Empty for a cercle, whose communes come from list_communes.

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true, so safety is covered. The description adds useful behavioral context about hierarchical resolution, including which child units are returned for which level, and the shared-name disambiguation behavior involving level. It does not contradict annotations.

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

Conciseness5/5

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

The description is dense but efficient: it front-loads the return contents, then states when to use it, then names alternatives. Every sentence earns its place and no filler is present.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the rich schema, output schema, and read-only annotations, the description is largely complete for invocation and selection. It clearly explains what is returned and routes to siblings. A minor gap is that 'préfecture' is mentioned as a supported unit type but does not appear in the level enum, which could leave an agent uncertain how to disambiguate a préfecture when a name is shared.

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 coverage is 100% and the schema already explains code/slug usage and the shared-name level disambiguation. The description reinforces the unit hierarchy and maps it to typical questions, but it adds little parameter-level detail beyond what the schema already provides, so the baseline 3 is appropriate.

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 description names a specific resource type (région, province, préfecture, cercle) and enumerates exactly what is returned: names in French/Arabic, 2024 population, households, ancestors, and children. It also differentiates itself from sibling tools by naming get_commune for lower-level units and list_communes for listing communes.

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?

The description explicitly states the tool's target: 'This is the tool for a question about a unit above the commune, such as how many cercles a province has.' It also gives clear alternatives: call get_commune for a commune or arrondissement, and list_communes to list a unit's communes. The routing guidance is unambiguous.

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

list_communesList communesA
Read-onlyIdempotent
Inspect

Communes filtered by région, province or préfecture, cercle, type or population, 50 to a page, in code order or sorted by name, population, change since 2014, density, area, any census indicator or any establishment count. Filters combine; each unit can be given by code or slug. With no filter it lists every commune, so sort: "-population" alone gives the largest in the country.

ParametersJSON Schema
NameRequiredDescriptionDefault
pageNoPage number, from 1.
sortNoA field to order by: code, name, population, change, density, area, or a census indicator by its path, such as labour.unemploymentRate or amenities.runningWater, as get_indicators names them. Put 2014. before the path for the 2014 figure, or change. for how far it moved since, as in change.illiteracy.rate10Plus. An establishment count goes under economy., as in economy.establishments.jobs or economy.sector.commerce, as get_economy names them. A count on its own ranks the biggest places first, so 3 figures worked out from 2 counts rank by size of place rather than size: economy.per1000.establishments, economy.per1000.jobs and economy.perBusiness.jobs. A leading minus puts the largest first. Code order when left out.
typeNoUrban or rural communes only.
cercleNoA cercle, by code or slug.
regionNoA région, by code or slug.
provinceNoA province or préfecture, by code or slug.
max_populationNoOnly communes with at most this many people in 2024.
min_populationNoOnly communes with at least this many people in 2024.

Output Schema

ParametersJSON Schema
NameRequiredDescription
pageYes
totalYes
communesYes
total_pagesYes

TDQS

A4.7/5.0
Behavior4/5

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

Annotations indicate readOnlyHint and idempotentHint true, so it's a safe read operation. The description adds pagination behavior (50 per page), sorting defaults, and combination of filters, which are not in annotations. No contradiction.

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

Conciseness5/5

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

The description is long but front-loaded with the core purpose, and every sentence adds necessary detail about sorting and filtering options. No fluff; it's dense but organized.

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?

Given high complexity (8 params, complex sort syntax), the description covers all essential usage patterns. Output schema exists, so return details are provided. Complete for agent to select and invoke correctly.

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 parameters are documented in schema. But description adds value by explaining how sort works with indicator paths (e.g., labour.unemploymentRate, change. prefix, per1000 counts) and that filters combine. This goes beyond 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 description clearly states it lists communes with various filters, sorting, and pagination. It distinguishes from siblings by mentioning sorting by indicators and establishment counts, which are unique to this tool. The verb 'list' and resource 'communes' are specific.

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?

It explicitly describes when to use it (e.g., no filter lists all communes, sort by -population for largest). It also implies when not to use it (e.g., for individual commune details, use get_commune or commune_at). It provides clear context for filtering and sorting.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 9 tool updates
    • First observedcommune_at
    • First observedcommunes_near
    • First observedget_commune
    • First observedget_economy
    • First observedget_housing
    • First observedget_indicators
    • First observedget_unit
    • First observedlist_communes
    • First observedsearch

Related MCP Connectors

Related MCP Servers

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.