Skip to main content
Glama

Growkik Directorios

Contar empresas

contar_empresas
Read-onlyIdempotent

Cuenta empresas agrupadas por estado, municipio, categoría, tamaño o directorio, con los mismos filtros que buscar_empresas. Sirve para dimensionar un mercado (p. ej. cuántas agencias aduanales hay por estado). Devuelve hasta 50 grupos, de mayor a menor.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "agrupar_por": "<agrupar_por>"
    },
    "name": "contar_empresas"
  }
}

Input Schema

NameRequiredDescriptionDefault
textoNoPalabras a buscar, igual que en buscar_empresas.
estadoNoEstado de México (nombre, slug o abreviatura como CDMX, NL, Edomex). Omitir = todo el país.
categoriaNoSlug o nombre de categoría (ver listar_directorios), p. ej. naves-industriales, automotriz-aeroespacial, agencias-aduanales.
municipioNoMunicipio o ciudad, p. ej. Monterrey, Apodaca, Tijuana.
alta_desdeNoSolo establecimientos que entraron al DENUE desde ese año o mes, 'AAAA' o 'AAAA-MM'. Es la fecha de alta en el DENUE, no la de fundación.
directorioNoconstruccion, industria, inmobiliarias o transporte. Omitir busca en los cuatro.
agrupar_porYesCómo agrupar el conteo. anio_alta: año en que los establecimientos entraron al DENUE.
con_contactoNoSolo empresas que tienen teléfono o correo en la descarga de pago.
con_sitio_webNoSolo empresas con sitio web.
tamano_minimoNoTamaño mínimo por plantilla DENUE: micro (0-5), pequena (6-30), mediana (31-100), grande (101+).
capital_extranjeroNoSolo empresas con inversión extranjera registrada en el RNIE de la Secretaría de Economía.
proveedor_gobiernoNoSolo empresas con contratos federales desde 2024 en ComprasMX (coincidencia por razón social).
certificado_ambientalNoSolo empresas con un certificado ambiental vigente de PROFEPA (Industria Limpia o Calidad Ambiental).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • changedInput schema / properties / agrupar_por / description
      Previous value: -"Cómo agrupar el conteo."New value: +"Cómo agrupar el conteo. anio_alta: año en que los establecimientos entraron al DENUE."
    • changedInput schema / properties / agrupar_por / enum
      Previous value: -[
      -  "estado",
      -  "municipio",
      -  "categoria",
      -  "tamano",
      -  "directorio"
      -]New value: +[
      +  "estado",
      +  "municipio",
      +  "categoria",
      +  "tamano",
      +  "directorio",
      +  "anio_alta"
      +]
    • addedInput schema / properties / alta_desde
      Added value: +{
      +  "description": "Solo establecimientos que entraron al DENUE desde ese año o mes, 'AAAA' o 'AAAA-MM'. Es la fecha de alta en el DENUE, no la de fundación.",
      +  "maxLength": 7,
      +  "type": "string"
      +}
    • addedInput schema / properties / capital_extranjero
      Added value: +{
      +  "description": "Solo empresas con inversión extranjera registrada en el RNIE de la Secretaría de Economía.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / certificado_ambiental
      Added value: +{
      +  "description": "Solo empresas con un certificado ambiental vigente de PROFEPA (Industria Limpia o Calidad Ambiental).",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / proveedor_gobierno
      Added value: +{
      +  "description": "Solo empresas con contratos federales desde 2024 en ComprasMX (coincidencia por razón social).",
      +  "type": "boolean"
      +}
  2. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already cover safety (readOnly, idempotent, non-destructive, closed-world), so the bar is lower. The description still adds genuinely useful behavior beyond them: the result is capped at 50 groups and ordered descending, which tells the agent to expect truncation on high-cardinality groupings.

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?

Three short sentences: what it counts, why to use it, what it returns. Front-loaded with the operation and dimension list, zero filler, and the example earns its space by making the aggregation use case concrete.

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?

For a 13-parameter read-only aggregation tool with full schema coverage and no output schema, the definition covers purpose, usage and result shape (groups, cap, ordering) adequately. It could say slightly more about what a group record contains, but nothing essential is missing.

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%, so the schema already documents all 13 filters, enum options and units. The description only restates the grouping dimensions already listed in agrupar_por and defers filters to buscar_empresas; baseline 3 applies.

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?

Opens with a specific verb+resource ("Cuenta empresas") and enumerates the grouping dimensions, then immediately contrasts with the listing sibling ("con los mismos filtros que buscar_empresas"). An agent can distinguish counting from listing without opening either schema.

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?

"Sirve para dimensionar un mercado" plus a concrete example (agencias aduanales por estado) gives a clear use context, and the reference to buscar_empresas implies the split: aggregation vs. record retrieval. No explicit when-not or exclusion is stated, so it stops short of a 5.

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