Skip to content

Conversation

@Prashant-7718
Copy link
Contributor

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:

  • Create diagram
  • Get diagram
  • Update diagram
  • Delete diagram
  • Repair diagram (new)

The implementation follows existing SDK patterns, maintains full backward compatibility, and aligns with current MCP tools for diagram management.

@vercel
Copy link

vercel bot commented Jan 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Review Updated (UTC)
office-plugin-site Ignored Ignored Jan 29, 2026 4:26pm

Request Review

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.

2 participants