Skip to main content
Glama

get_joomla_categories

Retrieve all categories from a Joomla website to organize content, manage site structure, and streamline content administration.

Instructions

Retrieve all categories from the Joomla website.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • main.py:80-112 (handler)
    The async function get_joomla_categories fetches categories from the Joomla API using httpx, parses the JSON response, and formats a list of category IDs and titles. It includes comprehensive error handling for HTTP errors, JSON parsing, and general exceptions. The @mcp.tool decorator registers it as an MCP tool.
    @mcp.tool(description="Retrieve all categories from the Joomla website.")
    async def get_joomla_categories() -> str:
        """Retrieve all categories from the Joomla website via its API."""
        try:
            headers = {
                "Accept": "application/vnd.api+json",
                "User-Agent": "JoomlaArticlesMCP/1.0",
                "Authorization": f"Bearer {BEARER_TOKEN}",
            }
            async with httpx.AsyncClient() as client:
                response = await client.get(JOOMLA_CATEGORIES_API_URL, headers=headers)
            if response.status_code != 200:
                return f"Failed to fetch categories: HTTP {response.status_code} - {response.text}"
            try:
                data = json.loads(response.text)
                categories = data.get("data", [])
                if not isinstance(categories, list):
                    return f"Error: Expected a list of categories, got {type(categories).__name__}: {response.text}"
                if not categories:
                    return "No categories found."
                result = "Available categories:\n"
                for category in categories:
                    attributes = category.get("attributes", {})
                    category_id = attributes.get("id", "N/A")
                    category_title = attributes.get("title", "N/A")
                    result += f"- ID: {category_id}, Title: {category_title}\n"
                return result
            except json.JSONDecodeError:
                return f"Error parsing categories response: Invalid JSON - {response.text}"
        except httpx.HTTPError as e:
            return f"Error fetching categories: {str(e)}"
        except Exception as e:
            return f"Unexpected error: {str(e)}"
Behavior2/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 states the action ('retrieve') but doesn't mention any behavioral traits like whether it's read-only, if it requires authentication, rate limits, or what the output format is. This leaves significant gaps for a tool that interacts with a website.

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 that directly states the tool's purpose without any wasted words. It is appropriately sized and front-loaded, making it easy to understand at a glance.

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 has 0 parameters, 100% schema coverage, and an output schema exists, the description is minimally adequate. However, it lacks behavioral context (e.g., authentication needs, rate limits) and doesn't explain when to use it relative to siblings, which are gaps considering the complexity of interacting with a Joomla website.

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 tool has 0 parameters, and the schema description coverage is 100%, so there are no parameters to document. The description doesn't need to add parameter semantics, and it appropriately avoids unnecessary details, earning a baseline score of 4 for this context.

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 verb ('retrieve') and resource ('all categories from the Joomla website'), making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'get_joomla_articles', which retrieves articles rather than categories, though this distinction is implied by the resource name.

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, such as whether it should be used for listing categories before creating articles or how it relates to sibling tools like 'get_joomla_articles'. It lacks explicit context or exclusions, leaving usage unclear beyond the basic purpose.

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/nasoma/joomla-mcp-server'

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