Skip to main content
Glama

tool_get_answer_group_detail

Inspect answer group details including members, crops, and graded status to prepare for batch grading on Gradescope.

Instructions

Get detail for one answer group: members, crops, graded status.

Use this to inspect what answers are in a group before batch-grading.

Args:
    course_id: The Gradescope course ID.
    question_id: The question ID.
    group_id: The answer group ID.
    output_format: "markdown" or "json" for structured output.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
course_idYes
question_idYes
group_idYes
output_formatNomarkdown

Implementation Reference

  • Implementation of the answer group detail logic.
    def get_answer_group_detail(
        course_id: str,
        question_id: str,
        group_id: str,
        output_format: str = "markdown",
    ) -> str:
        """Get detailed information about a specific answer group.
    
        Shows the group's title, member submissions, graded status, and
        representative crop images. Use this to understand what answers
        are in a group before batch-grading.
    
        Args:
            course_id: The Gradescope course ID.
            question_id: The question ID.
            group_id: The answer group ID (from get_answer_groups).
            output_format: "markdown" (default) or "json" for structured output.
        """
        if not course_id or not question_id or not group_id:
            return "Error: course_id, question_id, and group_id are required."
    
        try:
            data = _fetch_answer_groups_json(course_id, question_id)
        except AuthError as e:
            return f"Authentication error: {e}"
        except ValueError as e:
            return f"Error: {e}"
        except Exception as e:
            return f"Error fetching answer group detail: {e}"
    
        groups = data.get("groups", [])
        submissions = data.get("submissions", [])
    
        # Find the target group
        target_group = None
        for g in groups:
            if str(g["id"]) == str(group_id):
  • Registration and MCP tool definition for get_answer_group_detail.
    @mcp.tool()
    def tool_get_answer_group_detail(
        course_id: str,
        question_id: str,
        group_id: str,
        output_format: str = "markdown",
    ) -> str:
        """Get detail for one answer group: members, crops, graded status.
    
        Use this to inspect what answers are in a group before batch-grading.
    
        Args:
            course_id: The Gradescope course ID.
            question_id: The question ID.
            group_id: The answer group ID.
            output_format: "markdown" or "json" for structured output.
        """
        return get_answer_group_detail(course_id, question_id, group_id, output_format)

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/Yuanpeng-Li/gradescope-mcp'

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