Added Repair Diagram Function to SDK Using Backend AI and Credit Management#31
Merged
sidharthv96 merged 1 commit intomainfrom Feb 4, 2026
Merged
Added Repair Diagram Function to SDK Using Backend AI and Credit Management#31sidharthv96 merged 1 commit intomainfrom
sidharthv96 merged 1 commit intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
sidharthv96
approved these changes
Feb 3, 2026
1b4d642 to
a8deb1c
Compare
a8deb1c to
02d81ed
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a new Repair Diagram function to the MermaidChart SDK. The SDK is designed to communicate directly with the MermaidChart backend for internal usage, and this change exposes the existing backend AI repair functionality in a structured and reusable way.
The new function calls the existing AI repair endpoint and relies entirely on backend-managed AI credit handling. User AI credits are validated and consumed on the server side, ensuring secure and consistent credit usage without any client-side logic.
This functionality is required for the MCP server, where a new repair tool will be available after user authentication. The tool uses this SDK function to repair broken Mermaid diagrams and consumes the authenticated user’s AI credits accordingly.
With this addition, the SDK now supports the complete diagram management lifecycle, including:
The implementation follows existing SDK patterns, maintains full backward compatibility, and aligns with current MCP tools for diagram management.