Skip to main content
Glama
datagouv

datagouv-mcp

by datagouv

get_metrics

Retrieve monthly visits and downloads statistics for datasets or resources on France's open data platform to analyze popularity, track usage trends, and understand consumption patterns.

Instructions

Get metrics (visits, downloads) for a dataset and/or a resource.

Returns monthly statistics including visits and downloads, sorted by month in descending order (most recent first). This tool is useful for analyzing the popularity and usage of datasets and resources, but is optional in the data exploration workflow.

Typical use cases:

  • Analyze which datasets/resources are most popular

  • Track usage trends over time

  • Understand data consumption patterns

Note: This is separate from the main data querying workflow. Use this after exploring datasets/resources if you need usage statistics.

Args: dataset_id: Optional dataset ID to get metrics for (obtained from search_datasets or get_dataset_info) resource_id: Optional resource ID to get metrics for (obtained from list_dataset_resources or get_resource_info) limit: Maximum number of monthly records to return (default: 12, max: 100)

Returns: Formatted text with monthly metrics for the dataset and/or resource

Note: At least one of dataset_id or resource_id must be provided. This tool only works with the production environment (DATAGOUV_ENV=prod). The Metrics API does not have a demo/preprod environment.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataset_idNo
resource_idNo
limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively adds context beyond basic functionality: it specifies the return format ('monthly statistics including visits and downloads, sorted by month in descending order'), notes environmental constraints ('only works with the production environment'), and mentions prerequisites ('At least one of dataset_id or resource_id must be provided'). It also clarifies the tool's optional nature in workflows. However, it lacks details on error handling, rate limits, or authentication needs, preventing a score of 5.

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 well-structured with clear sections (purpose, returns, typical use cases, notes, args, returns, and additional notes), making it easy to scan. It is appropriately sized for the tool's complexity, with each sentence adding value (e.g., explaining workflow integration, environmental constraints). However, some redundancy exists (e.g., repeating 'Note:' sections), and the 'Typical use cases' section, while helpful, could be more concise, slightly reducing efficiency.

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 tool's moderate complexity (3 parameters, no annotations, but with an output schema), the description is largely complete. It covers purpose, usage, parameters, returns, and environmental constraints. The output schema exists, so the description need not detail return values extensively, though it does mention 'Formatted text with monthly metrics.' However, it lacks information on error cases (e.g., what happens if invalid IDs are provided) or performance aspects like pagination, which would be needed for a score of 5.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, so the description must fully compensate. It does so by explaining all three parameters: 'dataset_id' and 'resource_id' are described as optional IDs obtained from specific sibling tools, and 'limit' is explained with its default and maximum values. The description also adds critical semantic information not in the schema, such as the requirement that at least one ID must be provided. This comprehensive coverage justifies a score of 5.

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's purpose: 'Get metrics (visits, downloads) for a dataset and/or a resource.' It specifies the verb ('Get') and resources ('dataset', 'resource'), and mentions the metrics include 'visits' and 'downloads'. However, it does not explicitly differentiate from sibling tools like 'get_dataset_info' or 'get_resource_info' in terms of what specific information is returned, which prevents a score of 5.

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?

The description provides clear context for when to use this tool: 'This tool is useful for analyzing the popularity and usage of datasets and resources, but is optional in the data exploration workflow' and 'Use this after exploring datasets/resources if you need usage statistics.' It also notes it's 'separate from the main data querying workflow.' However, it does not explicitly state when not to use it or name specific alternatives among siblings, which would be needed for a score of 5.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/datagouv/datagouv-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server