Skip to content

Advertise MCP proof and ledger schemas#1006

Closed
elianguitarra wants to merge 1 commit into
ramimbo:mainfrom
elianguitarra:codex/mcp-proof-ledger-schemas-946
Closed

Advertise MCP proof and ledger schemas#1006
elianguitarra wants to merge 1 commit into
ramimbo:mainfrom
elianguitarra:codex/mcp-proof-ledger-schemas-946

Conversation

@elianguitarra
Copy link
Copy Markdown

@elianguitarra elianguitarra commented Jun 6, 2026

Summary

  • add explicit MCP input schemas for get_proof and get_ledger_entry
  • document supported proof hash and ledger sequence arguments for agent/tool clients
  • add conformance coverage that verifies both schemas are advertised

Validation

  • .\.venv\Scripts\python.exe -m pytest tests\test_api_mcp.py tests\test_mcp_tools.py -> 131 passed, 1 warning
  • .\.venv\Scripts\ruff.exe check app\mcp.py tests\test_api_mcp.py -> All checks passed
  • .\.venv\Scripts\ruff.exe format --check app\mcp.py tests\test_api_mcp.py -> 2 files already formatted
  • git diff --check origin/main..HEAD -> clean

Scope

Summary by CodeRabbit

  • Improvements

    • Enhanced input validation for ledger entry and proof lookup tools with stricter parameter constraints, preventing invalid requests and improving data reliability.
  • Tests

    • Added comprehensive validation tests to verify tools enforce proper input constraints.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 6, 2026

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d075c9e6-cfc5-45fe-8c7c-d1bc55447a43

📥 Commits

Reviewing files that changed from the base of the PR and between 8bdd282 and 6b396dd.

📒 Files selected for processing (2)
  • app/mcp.py
  • tests/test_api_mcp.py

📝 Walkthrough

Walkthrough

This PR adds JSON input schema validation to two MCP tools: get_ledger_entry now requires an integer sequence parameter with a minimum value of 1, and get_proof now requires a hash string parameter constrained to exactly 64 lowercase hexadecimal characters. Test assertions were extended to validate both schema structures and constraint properties.

Changes

MCP Tool Input Schemas

Layer / File(s) Summary
Tool input schemas and validations
app/mcp.py, tests/test_api_mcp.py
get_ledger_entry and get_proof MCP tool definitions replaced with schema-validated input formats; sequence integer and hash 64-hex-character string are now required with explicit constraint rules. Test assertions extended to validate schema structure, required fields, type constraints, and pattern/length properties for both tools.

Possibly related PRs

  • ramimbo/mergework#937: Both PRs update app/mcp.py's MCP_TOOLS to add/expand MCP inputSchema validation for tool arguments and extend tests/test_api_mcp.py's tools/list assertions accordingly.
  • ramimbo/mergework#526: Both PRs modify the MCP get_proof tool contract: main PR adds strict input JSON schema validation for the hash argument, while retrieved PR changes get_proof handling of malformed stored Proof.public_json.
  • ramimbo/mergework#926: Both PRs extend app/mcp.py's MCP_TOOLS tool entries with JSON inputSchema and update tests/test_api_mcp.py's tools/list assertions to validate those schemas.

Comment @coderabbitai help to get the list of available commands and usage tips.

@elianguitarra
Copy link
Copy Markdown
Author

Closing this unclaimed PR to avoid overlapping with the already-open MCP proof/ledger schema surface in #974. I will look for a non-duplicate #946 surface instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant