Skip to main content
Glama

tool_prepare_grading_artifact

Prepare a cached markdown artifact containing prompt, rubric, reference answers, page URLs, and crop regions for automated grading workflows in Gradescope.

Instructions

Prepare a cached /tmp markdown artifact for grading a question.

The artifact includes the prompt, rubric, reference-answer notes, page URLs,
crop regions, and a confidence gate for auto-grading.

Args:
    course_id: The Gradescope course ID.
    assignment_id: The assignment ID.
    question_id: The question ID to prepare.
    submission_id: Optional sample submission ID to use for rubric/page context.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
course_idYes
assignment_idYes
question_idYes
submission_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The core logic for preparing the grading artifact.
    def prepare_grading_artifact(
        course_id: str,
        assignment_id: str,
        question_id: str,
        submission_id: str | None = None,
    ) -> str:
        """Prepare a cached markdown artifact in /tmp for an assignment question.
    
        The artifact includes question metadata, prompt text when available, rubric,
        a reference answer or fallback draft, and read-strategy notes for agents.
        """
        if not course_id or not assignment_id or not question_id:
            return "Error: course_id, assignment_id, and question_id are required."
    
        try:
            questions = _fetch_assignment_questions(course_id, assignment_id)
            target = questions.get(str(question_id))
            if not target:
                return (
                    f"Error: question `{question_id}` was not found in assignment "
                    f"`{assignment_id}`."
                )
    
            if submission_id is None:
                submission_id = _find_first_submission_id(course_id, question_id)
    
            ctx = _get_grading_context(course_id, question_id, submission_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 preparing grading artifact: {e}"
    
        props = ctx["props"]
        question = props.get("question", {})
        prompt_text, explanation = _extract_outline_prompt_and_reference(
  • MCP tool registration and wrapper for `tool_prepare_grading_artifact`.
    @mcp.tool()
    def tool_prepare_grading_artifact(
        course_id: str,
        assignment_id: str,
        question_id: str,
        submission_id: str | None = None,
    ) -> str:
        """Prepare a cached /tmp markdown artifact for grading a question.
    
        The artifact includes the prompt, rubric, reference-answer notes, page URLs,
        crop regions, and a confidence gate for auto-grading.
    
        Args:
            course_id: The Gradescope course ID.
            assignment_id: The assignment ID.
            question_id: The question ID to prepare.
            submission_id: Optional sample submission ID to use for rubric/page context.
        """
        return prepare_grading_artifact(
            course_id, assignment_id, question_id, submission_id
        )
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 the artifact is cached in /tmp and includes specific components, but doesn't disclose behavioral traits like whether this is a read-only operation, if it requires specific permissions, potential rate limits, or what happens on failure. For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior.

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, starting with the main purpose and listing included components. The Args section is clear and necessary given low schema coverage. There's minimal waste, though it could be slightly more streamlined by integrating the parameter explanations into the main text.

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 no annotations, 0% schema coverage, and an output schema present (which reduces need to explain return values), the description is moderately complete. It covers the tool's purpose and parameters but lacks details on behavioral aspects like error handling or performance. For a tool with 4 parameters and no annotations, it should provide more context on usage constraints or outcomes.

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?

Schema description coverage is 0%, so the description must compensate. It adds meaning by explaining each parameter's purpose: course_id, assignment_id, and question_id are required for identification, while submission_id is optional for providing rubric/page context. This clarifies semantics beyond the schema's basic titles, though it doesn't detail formats or constraints.

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 action ('prepare') and the resource ('cached /tmp markdown artifact for grading a question'), specifying it includes prompt, rubric, reference-answer notes, page URLs, crop regions, and confidence gate. It distinguishes from siblings like tool_grade_answer_group or tool_get_question_rubric by focusing on artifact preparation rather than grading or rubric retrieval, though it doesn't explicitly name alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when preparing grading artifacts, such as for auto-grading with a confidence gate, but doesn't explicitly state when to use this tool versus alternatives like tool_prepare_answer_key or tool_get_submission_grading_context. It mentions optional submission_id for rubric/page context, suggesting context for when to include it, but lacks clear exclusions or named sibling comparisons.

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

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