Skip to main content
Glama

get_page_content

Retrieve the complete content body of a specific page from a Canvas course using the course identifier and page URL or ID.

Instructions

Get the full content body of a specific page.

    Args:
        course_identifier: The Canvas course code (e.g., badm_554_120251_246794) or ID
        page_url_or_id: The page URL or page ID
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
course_identifierYes
page_url_or_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'get_page_content' tool. It resolves the course ID, makes a Canvas API request to fetch the page, extracts the title, body, and published status, formats the response, and returns the page content.
    @mcp.tool()
    @validate_params
    async def get_page_content(course_identifier: str | int, page_url_or_id: str) -> str:
        """Get the full content body of a specific page.
    
        Args:
            course_identifier: The Canvas course code (e.g., badm_554_120251_246794) or ID
            page_url_or_id: The page URL or page ID
        """
        course_id = await get_course_id(course_identifier)
    
        response = await make_canvas_request("get", f"/courses/{course_id}/pages/{page_url_or_id}")
    
        if "error" in response:
            return f"Error fetching page content: {response['error']}"
    
        title = response.get("title", "Untitled")
        body = response.get("body", "")
        published = response.get("published", False)
    
        if not body:
            return f"Page '{title}' has no content."
    
        course_display = await get_course_code(course_id) or course_identifier
        status = "Published" if published else "Unpublished"
    
        return f"Page Content for '{title}' in Course {course_display} ({status}):\n\n{body}"
  • The call to register_other_tools(mcp) within register_all_tools, which defines and registers the get_page_content tool (along with other page tools) using the @mcp.tool() decorator inside the register_other_tools function.
    register_other_tools(mcp)
  • Invocation of register_all_tools in the main server startup, which chains to the registration of the get_page_content tool.
    register_all_tools(mcp)
  • Type hints and docstring Args section define the input schema for the tool, used by FastMCP for tool schema generation.
    async def get_page_content(course_identifier: str | int, page_url_or_id: str) -> str:
        """Get the full content body of a specific page.
    
        Args:
            course_identifier: The Canvas course code (e.g., badm_554_120251_246794) or ID
            page_url_or_id: The page URL or page ID
        """
  • The register_other_tools function contains the nested definition of get_page_content and its @mcp.tool() registration.
    def register_other_tools(mcp: FastMCP):
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 content but doesn't mention whether it's a read-only operation, if it requires specific permissions, rate limits, or error handling. For a tool with no annotations, this lack of behavioral context is a significant gap.

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 appropriately sized and front-loaded, with the core purpose stated first in a clear sentence. The parameter explanations are concise and directly relevant. There's minimal waste, though the structure could be slightly improved by integrating the parameter details more seamlessly.

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 (2 parameters, no annotations, but with an output schema), the description is somewhat complete. It covers the basic purpose and parameters but lacks behavioral context and usage guidelines. The presence of an output schema reduces the need to explain return values, but overall, it's adequate with clear gaps.

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%, but the description adds some parameter semantics by explaining 'course_identifier' as 'The Canvas course code (e.g., badm_554_120251_246794) or ID' and 'page_url_or_id' as 'The page URL or page ID'. This provides basic meaning beyond the schema's titles. However, it doesn't fully compensate for the low coverage, as it lacks details on format constraints or examples for 'page_url_or_id'.

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 the full content body of a specific page.' It specifies the verb ('Get') and resource ('full content body of a specific page'), making it easy to understand. However, it doesn't explicitly differentiate from sibling tools like 'get_page_details' or 'get_front_page', which might offer overlapping functionality.

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. It doesn't mention sibling tools like 'get_page_details' or 'get_front_page', nor does it specify prerequisites or exclusions. The usage context is implied but not articulated, leaving gaps for an AI agent to infer correct application.

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/vishalsachdev/canvas-mcp'

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