Skip to main content
Glama
florinel-chis

Magento 2 GraphQL Documentation MCP Server

get_tutorial

Retrieve a complete Magento 2 GraphQL tutorial with all steps in order. Provide the tutorial name (e.g., 'checkout') to get the full step-by-step guide.

Instructions

Get complete tutorial with all steps in order

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tutorial_nameYesTutorial name, e.g., 'checkout'

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Registration of the 'get_tutorial' tool using @mcp.tool decorator with name and description
    @mcp.tool(
        name="get_tutorial",
        description="Get complete tutorial with all steps in order"
    )
    def get_tutorial(
        tutorial_name: Annotated[str, Field(description="Tutorial name, e.g., 'checkout'")]
    ) -> str:
        """Get sequential tutorial steps"""
        db = Database(DB_PATH)
    
        # Search for tutorial documents
        docs = list(db.query(
            "SELECT * FROM documents WHERE category = 'tutorials' AND (subcategory = ? OR file_path LIKE ?) ORDER BY file_path",
            [tutorial_name, f"tutorials/{tutorial_name}%"]
        ))
    
        if not docs:
            return f"Tutorial not found: {tutorial_name}\n\nAvailable tutorials: Use list_categories() to see all tutorials."
    
        # Format tutorial
        lines = [f"# {tutorial_name.title()} Tutorial", ""]
    
        for i, doc in enumerate(docs, 1):
            lines.append(f"## Step {i}: {doc['title']}")
            lines.append("")
            lines.append(f"**File:** {doc['file_path']}")
            lines.append("")
    
            if doc.get('description'):
                lines.append(doc['description'])
                lines.append("")
    
            # Get code examples
            code_blocks = list(db.query(
                "SELECT * FROM code_blocks WHERE document_id = ? AND language IN ('graphql', 'json') LIMIT 2",
                [doc['id']]
            ))
    
            if code_blocks:
                for block in code_blocks:
                    lines.append(f"```{block['language']}")
                    lines.append(block['code'])
                    lines.append("```")
                    lines.append("")
    
            lines.append("---")
            lines.append("")
    
        return "\n".join(lines)
  • Handler function implementing the tool logic: queries the database for tutorial documents with matching tutorial_name in the 'tutorials' category, formats them sequentially with step numbers, code examples, and returns as a formatted string
    def get_tutorial(
        tutorial_name: Annotated[str, Field(description="Tutorial name, e.g., 'checkout'")]
    ) -> str:
        """Get sequential tutorial steps"""
        db = Database(DB_PATH)
    
        # Search for tutorial documents
        docs = list(db.query(
            "SELECT * FROM documents WHERE category = 'tutorials' AND (subcategory = ? OR file_path LIKE ?) ORDER BY file_path",
            [tutorial_name, f"tutorials/{tutorial_name}%"]
        ))
    
        if not docs:
            return f"Tutorial not found: {tutorial_name}\n\nAvailable tutorials: Use list_categories() to see all tutorials."
    
        # Format tutorial
        lines = [f"# {tutorial_name.title()} Tutorial", ""]
    
        for i, doc in enumerate(docs, 1):
            lines.append(f"## Step {i}: {doc['title']}")
            lines.append("")
            lines.append(f"**File:** {doc['file_path']}")
            lines.append("")
    
            if doc.get('description'):
                lines.append(doc['description'])
                lines.append("")
    
            # Get code examples
            code_blocks = list(db.query(
                "SELECT * FROM code_blocks WHERE document_id = ? AND language IN ('graphql', 'json') LIMIT 2",
                [doc['id']]
            ))
    
            if code_blocks:
                for block in code_blocks:
                    lines.append(f"```{block['language']}")
                    lines.append(block['code'])
                    lines.append("```")
                    lines.append("")
    
            lines.append("---")
            lines.append("")
    
        return "\n".join(lines)
  • Input schema: tutorial_name parameter (string) with Field description 'Tutorial name, e.g., checkout'
    tutorial_name: Annotated[str, Field(description="Tutorial name, e.g., 'checkout'")]
  • Example usage of get_tutorial tool in the example script
    result = await session.call_tool("get_tutorial", arguments={
        "tutorial_name": "checkout"
    })
  • Test usage of get_tutorial tool in verify_server test script
    result = await session.call_tool("get_tutorial", arguments={
        "tutorial_name": "checkout"
    })
Behavior2/5

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

With no annotations, the description must convey behavior. It only states the result content ('with all steps in order') but omits any behavioral traits like side effects, authentication needs, rate limits, or how the output is structured.

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?

A single, front-loaded sentence that is efficient and focused. No wasted words.

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

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite low complexity and presence of an output schema, the description lacks usage context and behavioral details. It does not differentiate from siblings or explain the tool's role in a workflow.

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 100%, so baseline is 3. The description adds no further detail about the 'tutorial_name' parameter beyond what the schema provides (name and example).

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?

The description clearly states the verb 'Get' and the resource 'complete tutorial with all steps in order', making the tool's purpose explicit. It is specific enough to distinguish from siblings like 'get_document' or 'search_documentation'.

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?

No guidance is provided on when to use this tool versus alternatives. The description does not mention conditions, exclusions, or related sibling tools.

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/florinel-chis/magento-graphql-docs-mcp'

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