Skip to main content
Glama
GPA Calculator MCP

GPA Calculator MCP

Calculate GPA

calculate_gpa
Read-only

Computes term and cumulative GPA from course credits and grades, including weighted courses, dropped or replaced attempts, and transcript CSV input for academic planning.

Instructions

Calculate a GPA from a list of courses with credits and grades, optionally weighted with a credit multiplier on each course, and optionally combined with an earlier GPA and credit total. The GPA for the courses you pass is the term GPA, and adding earlier work with prior_gpa and prior_credits gives the cumulative GPA. Inputs: courses (each with credits greater than 0, a grade that is a letter like "B+" or a percentage like 87, and an optional credit_multiplier greater than 0 such as 1.1 for an AP class), a scale id, and optional prior_gpa and prior_credits to fold in earlier terms. A credit_multiplier above 1 gives a course more weight in the weighted GPA, and when any course has one other than 1 the tool also returns weighted_gpa and weighted_credits. The term GPA still uses the plain credits. Pass drop_lowest to leave the lowest graded courses out of the GPA, as schools do that drop the lowest course; the dropped courses are named in dropped_courses. Pass replace_repeats to count only the last listed attempt of a course that appears more than once, for schools that replace an earlier grade when a course is retaken; the replaced attempts are named in replaced_courses. Pass prior_gpa and prior_credits together, or leave both out. Passing only one of the two is an error, so the tool says which one is missing. Alternatively, pass transcript_csv as a CSV string with columns for course name, credits, grade and optional credit multiplier; a header row is optional, the columns can be in any order, and header names like Course Title, Final Grade and Credit Hours are read as the name, grade and credits columns. When courses is not given, transcript_csv is parsed and used as the course list. In transcript_csv, a P is read as pass, NP as not pass and W as withdrawn. Those rows are left out of the GPA and named in the answer, except where the scale gives the letter points, such as P on australia-hd. Example prompt: "What's my GPA if I got an A in 3 credits, a B+ in 4 credits and a C in 3 credits?"

Input Schema

NameRequiredDescriptionDefault
scaleNoGrade scale id: "us4", "us4plus", "ontario-college", "uk-classification", "australia-hd" or "weighted-5.0". Defaults to "us4". Ask the student which one their school uses if unsure.us4
coursesNoThe courses to include. Each needs credits (greater than 0) and a grade (a letter like "B+" or a percentage like 87). name is optional, and so is credit_multiplier (greater than 0), which gives a course more weight in the weighted GPA. Required when transcript_csv is not given.
prior_gpaNoGPA from earlier terms, 0 to 7. Pass this together with prior_credits to get a cumulative GPA. Passing only one of the two is an error.
drop_lowestNoNumber of courses with the lowest grade points to leave out of the GPA, 0 or more, for schools that drop the lowest course. It must be less than the number of graded courses. Ties go to the course listed first. Defaults to 0.
prior_creditsNoCredits from earlier terms, 0 or more. Pass this together with prior_gpa to get a cumulative GPA. Passing only one of the two is an error.
transcript_csvNoA CSV string with columns for course name, credits, grade and optional credit multiplier. A header row is optional, the columns can be in any order, and header names like Course Title, Final Grade and Credit Hours are read as the name, grade and credits columns. P, NP and W grades are left out of the GPA. When courses is not given, this is parsed and used as the course list. Example: "Course,Credits,Grade\nCalculus,4,A\nHistory,3,B+"
replace_repeatsNoSet to true when a retaken course replaces the earlier grade. Courses with the same name (ignoring case and extra spaces) are one course, and only the last one listed counts in the GPA. Courses without a name are never matched. The replaced attempts come back in replaced_courses. Defaults to false.

Output Schema

NameRequiredDescriptionDefault
scaleYesThe scale id the courses were marked on.
coursesYesOne entry per graded course, in the order they were passed.
creditsYesThe credits of the graded courses in this call.
term_gpaYesThe GPA for these courses alone.
scale_nameYesThe name of the scale the courses were marked on.
gpa_creditsYesThe credits that count in the GPA, the same graded credits the term GPA is divided by. Excluded courses add nothing here.
weighted_gpaNoThe GPA with each course's credits multiplied by its credit_multiplier, when at least one multiplier other than 1 was passed. It covers the courses in this call, not the earlier terms.
cumulative_gpaNoThe GPA with the earlier terms folded in, when prior_gpa and prior_credits were both passed.
dropped_coursesYesCourses left out because of drop_lowest. Empty when drop_lowest is 0 or not passed.
excluded_coursesYesCourses left out of the GPA because they are not graded, such as P, NP and W rows in transcript_csv. Empty when none were left out.
replaced_coursesYesEarlier attempts left out because replace_repeats was true and the course was listed again later. Empty when replace_repeats is false or not passed.
weighted_creditsNoThe credits after the credit multipliers are applied, when at least one multiplier other than 1 was passed.
cumulative_creditsNoThe credits of these courses and the earlier terms together, when prior_gpa and prior_credits were both passed.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.1.9
    • addedInput schema / properties / replace_repeats
      Added value: +{
      +  "description": "Set to true when a retaken course replaces the earlier grade. Courses with the same name (ignoring case and extra spaces) are one course, and only the last one listed counts in the GPA. Courses without a name are never matched. The replaced attempts come back in replaced_courses. Defaults to false.",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / replaced_courses
      Added value: +{
      +  "description": "Earlier attempts left out because replace_repeats was true and the course was listed again later. Empty when replace_repeats is false or not passed.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "credits": {
      +        "description": "Credits of the replaced attempt.",
      +        "type": "number"
      +      },
      +      "grade": {
      +        "description": "The grade of the replaced attempt, as it was passed.",
      +        "type": "string"
      +      },
      +      "name": {
      +        "description": "Name of the course whose earlier attempt was replaced.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "name",
      +      "credits",
      +      "grade"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "scale",
      -  "scale_name",
      -  "courses",
      -  "credits",
      -  "term_gpa",
      -  "gpa_credits",
      -  "excluded_courses",
      -  "dropped_courses"
      -]New value: +[
      +  "scale",
      +  "scale_name",
      +  "courses",
      +  "credits",
      +  "term_gpa",
      +  "gpa_credits",
      +  "excluded_courses",
      +  "dropped_courses",
      +  "replaced_courses"
      +]
  2. Changed11 schema fields changedv0.1.7
    • changedInput schema / properties / courses / description
      Previous value: -"The courses to include. Each needs credits (greater than 0) and a grade (a letter like \"B+\" or a percentage like 87). name is optional, and so is credit_multiplier (greater than 0), which gives a course more weight in the weighted GPA."New value: +"The courses to include. Each needs credits (greater than 0) and a grade (a letter like \"B+\" or a percentage like 87). name is optional, and so is credit_multiplier (greater than 0), which gives a course more weight in the weighted GPA. Required when transcript_csv is not given."
    • changedInput schema / properties / courses / items / required
      Previous value: -[
      -  "credits",
      -  "grade"
      -]New value: +[
      +  "credits"
      +]
    • addedInput schema / properties / drop_lowest
      Added value: +{
      +  "description": "Number of courses with the lowest grade points to leave out of the GPA, 0 or more, for schools that drop the lowest course. It must be less than the number of graded courses. Ties go to the course listed first. Defaults to 0.",
      +  "maximum": 9007199254740991,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedInput schema / properties / transcript_csv
      Added value: +{
      +  "description": "A CSV string with columns for course name, credits, grade and optional credit multiplier. A header row is optional, the columns can be in any order, and header names like Course Title, Final Grade and Credit Hours are read as the name, grade and credits columns. P, NP and W grades are left out of the GPA. When courses is not given, this is parsed and used as the course list. Example: \"Course,Credits,Grade\\nCalculus,4,A\\nHistory,3,B+\"",
      +  "type": "string"
      +}
    • removedInput schema / required
      Removed value: -[
      -  "courses"
      -]
    • changedOutput schema / properties / courses / description
      Previous value: -"One entry per course, in the order they were passed."New value: +"One entry per graded course, in the order they were passed."
    • changedOutput schema / properties / credits / description
      Previous value: -"The credits of the courses in this call."New value: +"The credits of the graded courses in this call."
    • addedOutput schema / properties / dropped_courses
      Added value: +{
      +  "description": "Courses left out because of drop_lowest. Empty when drop_lowest is 0 or not passed.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "credits": {
      +        "description": "Credits of the course dropped.",
      +        "type": "number"
      +      },
      +      "grade": {
      +        "description": "The letter the dropped course counted as on the scale.",
      +        "type": "string"
      +      },
      +      "name": {
      +        "description": "Name of the course dropped.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "name",
      +      "credits",
      +      "grade"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / excluded_courses
      Added value: +{
      +  "description": "Courses left out of the GPA because they are not graded, such as P, NP and W rows in transcript_csv. Empty when none were left out.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "credits": {
      +        "description": "Credits of the course left out.",
      +        "type": "number"
      +      },
      +      "grade": {
      +        "description": "The grade that kept the course out of the GPA, such as P, NP or W.",
      +        "type": "string"
      +      },
      +      "name": {
      +        "description": "Name of the course left out of the GPA.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "name",
      +      "credits",
      +      "grade"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / gpa_credits
      Added value: +{
      +  "description": "The credits that count in the GPA, the same graded credits the term GPA is divided by. Excluded courses add nothing here.",
      +  "type": "number"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "scale",
      -  "scale_name",
      -  "courses",
      -  "credits",
      -  "term_gpa"
      -]New value: +[
      +  "scale",
      +  "scale_name",
      +  "courses",
      +  "credits",
      +  "term_gpa",
      +  "gpa_credits",
      +  "excluded_courses",
      +  "dropped_courses"
      +]
  3. First observedv0.1.4

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare readOnlyHint and openWorldHint, so the description carries the behavioral load and does it well: it discloses that weighted_gpa/weighted_credits are returned only when a multiplier other than 1 is present, that term GPA still uses plain credits, that dropped_courses and replaced_courses are reported back, and that passing only one of prior_gpa/prior_credits produces an error naming the missing one. P/NP/W handling and the australia-hd exception are also spelled out.

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 core definition is front-loaded in the first two sentences and the rest is organized by feature (weighting, cumulative, drop_lowest, replace_repeats, CSV), so it scans well. It is still a dense block with some overlap against the schema descriptions, which keeps it from a 5.

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

Completeness5/5

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

For a seven-parameter tool with six scale options, two input paths, and optional post-processing, the description covers input requirements, mode interactions, error behavior and even an example prompt. An output schema exists, yet the description still flags the conditional return fields, so nothing an agent needs in order to call this correctly is missing.

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 coverage is 100%, so the baseline is 3, but the description adds genuine cross-parameter meaning that the schema does not: transcript_csv is only used when courses is absent, prior_gpa and prior_credits must be supplied together, and drop_lowest/replace_repeats interact with the returned fields. It stops short of 5 because the per-field constraints (credits > 0, multiplier > 0, header aliases) are largely restated from the schema.

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 first clause states a specific verb and resource — 'Calculate a GPA from a list of courses with credits and grades' — and the body then scopes it to term GPA, cumulative GPA, weighted GPA and CSV-sourced input. That scope cleanly separates it from siblings like convert_gpa_scale and weighted_grade, which each do a narrower job.

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

Usage Guidelines4/5

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

The description gives explicit conditional guidance for the optional modes: use prior_gpa+prior_credits for cumulative, drop_lowest for schools that drop the lowest course, replace_repeats for retake policies, and transcript_csv when courses is not given. It never names a sibling tool as an alternative, so the agent gets no explicit routing to target_gpa_planner or needed_on_final, which keeps it off a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.