Skip to main content
Glama
cornelcroi

French Tax MCP Server

by cornelcroi

get_tax_procedure

Retrieve official French tax procedure information from service-public.fr to understand required steps and documentation for specific tax processes.

Instructions

Get information about a tax procedure from service-public.fr

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
procedure_nameYes
ctxNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Registration of the MCP tool 'get_tax_procedure' with wrapper function that delegates to scraper
    @mcp.tool(
        name="get_tax_procedure",
        description="Get information about a tax procedure from service-public.fr",
    )
    async def get_tax_procedure_wrapper(
        procedure_name: str,
        ctx: Optional[Context] = None,
    ) -> Optional[Dict]:
        """Get information about a tax procedure from service-public.fr.
    
        Args:
            procedure_name: Name of the procedure (e.g., 'declaration_revenus', 'credit_impot')
            ctx: MCP context for logging
    
        Returns:
            Dict: Dictionary containing procedure information
        """
        try:
            if ctx:
                await ctx.info(f"Getting tax procedure information for {procedure_name}")
    
            from french_tax_mcp.scrapers.service_public_scraper import get_tax_procedure
            result = await get_tax_procedure(procedure_name)
            return result
        except Exception as e:
            if ctx:
                await ctx.error(f"Failed to get tax procedure: {e}")
            return {
                "status": "error",
                "message": f"Error getting tax procedure: {str(e)}",
            }
  • Core handler implementation in ServicePublicScraper class that performs web scraping for tax procedure information
    async def get_tax_procedure(self, procedure_name: str) -> Dict:
        """Scrape information about a tax procedure from service-public.fr.
    
        Args:
            procedure_name: Name of the procedure (e.g., 'declaration_revenus', 'credit_impot')
    
        Returns:
            Dictionary containing information about the procedure
        """
        logger.info(f"Scraping information for procedure {procedure_name}")
    
        try:
            # Map procedure name to URL
            url = self._get_procedure_url(procedure_name)
    
            if not url:
                return self.format_result(
                    status="error",
                    message=f"Unknown procedure: {procedure_name}",
                    data={"procedure": procedure_name},
                )
    
            # Get the page
            response = await self.get_page(url)
    
            # Parse HTML
            soup = self.parse_html(response.text)
    
            # Extract procedure information
            procedure_info = self._extract_procedure_info(soup, procedure_name)
    
            return self.format_result(
                status="success",
                data=procedure_info,
                message=f"Successfully retrieved information for procedure {procedure_name}",
                source_url=f"{BASE_URL}{url}",
            )
    
        except Exception as e:
            logger.error(f"Error scraping procedure information: {e}")
            return self.format_result(
                status="error",
                message=f"Failed to retrieve procedure information: {str(e)}",
                data={"procedure": procedure_name},
                error=e,
            )
  • Helper function that provides a standalone interface to the scraper's get_tax_procedure method via singleton instance
    async def get_tax_procedure(procedure_name: str) -> Dict:
        """Scrape information about a tax procedure from service-public.fr.
    
        Args:
            procedure_name: Name of the procedure (e.g., 'declaration_revenus', 'credit_impot')
    
        Returns:
            Dictionary containing information about the procedure
        """
        return await service_public_scraper.get_tax_procedure(procedure_name)
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions retrieving information from 'service-public.fr', implying an external API/web source, but doesn't disclose behavioral traits like authentication requirements, rate limits, error handling, or what format the information returns. For a tool with external dependencies and no annotation coverage, this is insufficient.

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, efficient sentence that states the core purpose without unnecessary words. It's appropriately sized for a simple retrieval tool, though it could be more front-loaded with distinguishing features if they existed.

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 2 parameters with 0% schema coverage, no annotations, but an output schema exists, the description is minimally adequate. The output schema reduces the need to explain return values, but the description lacks crucial context about external dependencies, error cases, and parameter usage that would be needed for reliable tool invocation.

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 0%, so the description must compensate. It mentions 'tax procedure' which aligns with the 'procedure_name' parameter, adding semantic context about what kind of name to provide. However, it doesn't explain the 'ctx' parameter or provide format/example details for either parameter, leaving significant gaps in parameter understanding.

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

Purpose3/5

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

The description states the tool 'Get information about a tax procedure from service-public.fr', which provides a clear verb ('Get information') and resource ('tax procedure') with source context. However, it doesn't differentiate from sibling tools like 'get_tax_info_from_web' or 'get_tax_article', leaving ambiguity about what specific type of information or procedure scope this covers.

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. With multiple sibling tools for tax information retrieval (e.g., get_tax_info_from_web, get_tax_article, get_form_details), there's no indication of what distinguishes this procedure-focused tool from others, leaving the agent to guess based on tool names alone.

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