Skip to main content
Glama

score_pull_request

Score a pull request for production reliability using Tomosu AI.

Analyzes PR patch diffs and returns PRI score, merge verdict, sub-index breakdown (FI/GC/CV), and top recommendations with before/after code snippets.

Before scoring the PR diff, the backend ensures a base-branch baseline (and its Tomosu Ontology Graph in Neo4j) exists and is fresh for this repo/branch, building one if missing or stale — same pipeline shape as the Tomosu GitHub App. The PR scan then runs with that graph context available (cross-file imports/symbols), same as the GitHub App gets. First scan of a repo/branch is slow (builds the baseline — can take a few minutes); repeat scans on the same branch are fast.

Call this once before writing the PR walkthrough summary. Include the returned PRI score and merge verdict at the top of the summary.

Args: repo: Repository in "owner/repo" format (e.g. "acme/backend"). pr_number: Pull request number (e.g. 42). source: Who is calling this tool. If you are Claude (Claude Code, Claude Desktop, claude.ai) you MUST pass source="claude" — this runs the full-depth scan (suggest-v3) for both the base-branch baseline and the PR, and is slower. CodeRabbit passes source="coderabbit". Any other value (or omitting it) runs the fast lightweight scan (suggest-lite). Response shape is identical.

Returns: JSON with pri, merge_ready, indices (fi/gc/cv), recommendations, total_issues (scores for the PR's changed files), plus baseline_scores {pri, fi, gc, cv} for the whole base branch (repo-level PRI) when the baseline is available.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repoYes
sourceNocoderabbit
pr_numberYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so richly: it discloses the implicit baseline build (and Neo4j ontology graph freshness step), that first-scan-per-branch is slow (minutes) while repeats are fast, and that the source parameter changes scan depth. These are non-obvious operational traits an agent must know before invoking.

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?

Front-loaded with the purpose and return shape, then behavioral context, then args. It is somewhat long and slightly redundant between the prose return description and the Returns block, but nearly every sentence adds actionable information (latency expectations, source semantics).

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?

An output schema exists, yet the description still gives a useful human-readable summary of the response fields. Combined with the latency, baseline, and source-depth disclosures, an agent has everything needed to call this correctly and interpret results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/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, and it does: it documents repo format ('owner/repo'), pr_number with an example, and critically the source parameter's semantics — which values run full-depth vs lightweight scans and that response shape is unchanged. This is meaning well beyond anything in the bare 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?

States a specific verb+resource ('Score a pull request') and names the product (Tomosu AI) plus what dimension is scored (production reliability). It is immediately distinguishable from siblings like suggest_code or get_scan_report, and the description enumerates exactly what is returned (PRI, merge verdict, FI/GC/CV sub-indices, recommendations).

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?

Explicitly says 'Call this once before writing the PR walkthrough summary' and to surface the PRI score/merge verdict at the top, which is clear usage context. It does not name alternative sibling tools or state when NOT to call it, so it falls short of the full when/when-not/alternatives bar.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources