Skip to content

feat: add create_subscription_registration_link MCP tool#91

Open
jating06 wants to merge 9 commits into
mainfrom
feat/add-create-subscription-registration-link-tool
Open

feat: add create_subscription_registration_link MCP tool#91
jating06 wants to merge 9 commits into
mainfrom
feat/add-create-subscription-registration-link-tool

Conversation

@jating06

Copy link
Copy Markdown
Contributor

Summary

  • Adds create_subscription_registration_link MCP tool wrapping the Razorpay POST /v1/subscription_registration/auth_links API
  • Registered as a write tool in the payment_links toolset
  • Allows merchants to create auth links sent to customers (via SMS/email) to authorize recurring payment mandates (card, emandate, nach, etc.)
  • Also fixes a pre-existing build failure in pkg/mcpgo/server.go caused by the mcp-go v0.45.0 upgrade changing OnAfterCallToolFunc's result parameter type from *mcp.CallToolResult to any

Parameters

Parameter Type Required Description
customer object Customer details: name, email, contact
type string Auth mechanism type ("link")
amount number Amount in smallest currency subunit
currency string ISO 4217 currency code (e.g. INR, MYR)
subscription_registration object Mandate details: method, max_amount, expire_at, frequency
description string Description of the registration link
receipt string Internal receipt reference (max 40 chars)
email_notify boolean Send email notification
sms_notify boolean Send SMS notification
expire_by number Unix timestamp when the link expires
notes object Key-value metadata (max 15 pairs)

Test plan

  • go test ./... passes (all 9 packages)
  • No new long lines without //nolint:lll
  • Tests cover: full success, required-params-only success, missing required param, wrong type, API error

🤖 Generated with Claude Code

jating06 and others added 4 commits March 10, 2026 16:04
Add comprehensive agent skill for integrating Razorpay UPI Reserve Pay APIs, enabling merchants to implement single-block multiple-debit recurring payment workflows with proper authorization and execution handling.

Made-with: Cursor
Adds the create_subscription_registration_link tool that wraps the
Razorpay POST /v1/subscription_registration/auth_links API.

The tool allows merchants to create registration auth links that are
sent to customers (via SMS/email) to authorize a recurring payment
mandate (card, emandate, nach, etc.).

Also fixes a pre-existing build failure in pkg/mcpgo/server.go caused
by the mcp-go v0.45.0 upgrade changing OnAfterCallToolFunc's result
parameter type from *mcp.CallToolResult to any.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jating06 and others added 5 commits March 19, 2026 15:54
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The result parameter must be *mcp.CallToolResult, not any, to match the
OnAfterCallToolFunc type defined in mcp-go v0.43.2.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Moves the skill from ~/.claude/skills into .claude/skills so it is
version-controlled alongside the codebase it operates on.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The tool belongs to a separate resource (subscription_registration),
not payment_links. Extract it into:
- pkg/razorpay/subscription_registration_links.go
- pkg/razorpay/subscription_registration_links_test.go

Register it under a new `subscription_registration_links` toolset in
tools.go instead of the payment_links toolset.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov-commenter

codecov-commenter commented Mar 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.18182% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.33%. Comparing base (64e5a74) to head (ea0873c).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
pkg/razorpay/subscription_registration_links.go 98.05% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #91      +/-   ##
==========================================
+ Coverage   97.32%   97.33%   +0.01%     
==========================================
  Files          34       35       +1     
  Lines        7370     7480     +110     
==========================================
+ Hits         7173     7281     +108     
- Misses        134      135       +1     
- Partials       63       64       +1     
Flag Coverage Δ
unittests 97.33% <98.18%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

6 participants