Skip to main content
Glama
cornelcroi

French Tax MCP Server

by cornelcroi

get_tax_article

Retrieve official French tax law articles from legifrance.gouv.fr by specifying article IDs to access current legal information.

Instructions

Get information about a tax law article from legifrance.gouv.fr

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
article_idYes
ctxNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Registration of the 'get_tax_article' MCP tool using the @mcp.tool decorator with name and description.
    @mcp.tool(
        name="get_tax_article",
        description="Get information about a tax law article from legifrance.gouv.fr",
    )
  • Handler function registered as MCP tool 'get_tax_article'. Logs the request, calls the scraper function, and handles errors.
    async def get_tax_article_wrapper(
        article_id: str,
        ctx: Optional[Context] = None,
    ) -> Optional[Dict]:
        """Get information about a tax law article from legifrance.gouv.fr.
    
        Args:
            article_id: Article identifier (e.g., '200', '4B')
            ctx: MCP context for logging
    
        Returns:
            Dict: Dictionary containing article information
        """
        try:
            if ctx:
                await ctx.info(f"Getting tax article information for {article_id}")
    
            result = await get_tax_article(article_id)
            return result
        except Exception as e:
            if ctx:
                await ctx.error(f"Failed to get tax article: {e}")
            return {
                "status": "error",
                "message": f"Error getting tax article: {str(e)}",
            }
  • Core scraping logic in LegalScraper.get_tax_article method: constructs Legifrance URL, fetches page, parses HTML, extracts info, formats result.
    async def get_tax_article(self, article_id: str) -> Dict:
        """Scrape information about a tax law article from legifrance.gouv.fr.
    
        Args:
            article_id: Article identifier (e.g., '200', '4B')
    
        Returns:
            Dictionary containing information about the article
        """
        logger.info(f"Scraping information for article {article_id}")
    
        try:
            # Construct URL
            url = f"/codes/id/LEGITEXT000006069577/LEGIARTI000{article_id}"
    
            # Get the page
            response = await self.get_page(url)
    
            # Parse HTML
            soup = self.parse_html(response.text)
    
            # Extract article information
            article_info = self._extract_article_info(soup, article_id)
    
            return self.format_result(
                status="success",
                data=article_info,
                message=f"Successfully retrieved information for article {article_id}",
                source_url=f"{BASE_URL}{url}",
            )
    
        except Exception as e:
            logger.error(f"Error scraping article information: {e}")
            return self.format_result(
                status="error",
                message=f"Failed to retrieve article information: {str(e)}",
                data={"article": article_id},
                error=e,
            )
  • Convenience free function that delegates to the singleton LegalScraper instance's get_tax_article method.
    async def get_tax_article(article_id: str) -> Dict:
        """Scrape information about a tax law article from legifrance.gouv.fr.
    
        Args:
            article_id: Article identifier (e.g., '200', '4B')
    
        Returns:
            Dictionary containing information about the article
        """
        return await legal_scraper.get_tax_article(article_id)
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves information, implying a read-only operation, but doesn't specify whether it requires authentication, has rate limits, returns structured data, or handles errors. The description adds minimal behavioral context beyond the basic action, leaving gaps for an AI agent.

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 a single, efficient sentence with zero wasted words. It's front-loaded with the core purpose and includes the data source. Every part earns its place, making it easy to parse quickly without unnecessary elaboration.

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

Completeness3/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 (retrieving specific legal information), no annotations, and an output schema (which handles return values), the description is minimally adequate. It states what the tool does and the source, but lacks details on parameters, behavioral traits, and usage context, leaving the agent to rely heavily on the output schema and inference.

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

Parameters2/5

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

Schema description coverage is 0%, so the schema provides no parameter documentation. The description mentions 'a tax law article' but doesn't explain the 'article_id' parameter (e.g., format, examples, or source) or the optional 'ctx' parameter. It adds minimal semantic value beyond what's inferable from the tool name, failing to compensate for the schema gap.

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 action ('Get information about') and the resource ('a tax law article from legifrance.gouv.fr'), which is specific and unambiguous. It doesn't explicitly differentiate from siblings like 'search_tax_law' or 'get_tax_info_from_web', but the focus on retrieving a specific article by ID is implied. No tautology with the name/title.

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 provides no guidance on when to use this tool versus alternatives like 'search_tax_law' or 'get_tax_info_from_web'. It mentions the source (legifrance.gouv.fr) but doesn't specify prerequisites, exclusions, or comparative contexts. Usage is implied only by the verb 'Get', with no explicit when/when-not instructions.

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/cornelcroi/french-tax-mcp'

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