new-tool-from-docs

new-tool-from-docs is a cursor rule for Cursor from razorpay/razorpay-mcp-server. It costs 2,205 tokens per session, scanned A, original, MIT.

A rule for generating Razorpay MCP server tools from a Razorpay API documentation link and the Go SDK function the tool must call. MCP lets an AI system use server-provided functions.

In plain words
What is it for?
Use it to implement, register, test, and document a Razorpay tool from the specified API contract and SDK function.
Why use it?
It prevents implementation from starting when either required input is missing or incorrectly formatted and provides a required completion checklist.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/razorpay/razorpay-mcp-server/new-tool-from-docs
Clone the repo
git clone --depth 1 https://github.com/razorpay/razorpay-mcp-server

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for new-tool-from-docs

README.md
[![agentmods](https://agentmods.dev/badge/rules/razorpay/razorpay-mcp-server/new-tool-from-docs.svg)](https://agentmods.dev/rules/razorpay/razorpay-mcp-server/new-tool-from-docs)
Your own site
<a href="https://agentmods.dev/rules/razorpay/razorpay-mcp-server/new-tool-from-docs"><img src="https://agentmods.dev/badge/rules/razorpay/razorpay-mcp-server/new-tool-from-docs.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,205 This file is loaded in full into every session.
When invoked 2,205 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.02205 $0.02205
Opus 5 $0.01103 $0.01103
Sonnet 5 $0.00441 $0.00441
Haiku 4.5 $0.00220 $0.00220

Measured 6d ago against content hash 5301d5352bbe, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

new-tool-from-docs scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/new-tool-from-docs.mdc · 262 lines

How it starts

The opening of the file, as written. The whole thing — 262 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Razorpay Tool Generator

This rule generates tool implementations for the Razorpay MCP server based on API documentation.

Required Format

This rule requires:

  1. A Razorpay API documentation URL starting with https://razorpay.com/docs/api/
  2. The SDK function signature that the tool will call

Example of valid invocation:

@new-tool-from-docs.mdc DOC_LINK: @https://razorpay.com/docs/api/payment-links/create-standard/
SDK_FUNCTION:
func (pl *PaymentLink) Create(data map[string]interface{}, extraHeaders map[string]string) (map[string]interface{}, error) {
    url := fmt.Sprintf("/%s%s", constants.VERSION_V1, constants.PaymentLink_URL)
    return pl.Request.Post(url, data, extraHeaders)
}

IMPORTANT: If the DOC_LINK or SDK_FUNCTION are missing or in an incorrect format, REFUSE to proceed further.

Implementation Checklist

This checklist MUST be included in the final response to verify all implementation steps are complete. IMPORTANT: Include this unchecked checklist at the END of the implementation, NOT at the beginning.

  • Implement tool function based on API docs
  • Register tool in tools.go
  • Create unit tests with full coverage (positive case, all negative cases, edge cases)
  • Update the "Available Tools" section in the main README.md. Make sure the new additions are correctly formatted.
  • Double check that we are not repeating any of the Common Issues mentioned below.
  • Run linter and fix errors if any (REQUIRED)
  • Run tests and fix errors if any (REQUIRED)

COMPLETION CRITERIA:

  1. The task is considered accomplished only if the checklist and summary are posted.
  2. Once the task is completed you should stop and give control to the user. You SHOULD NOT infer additional tools to implement.

⚠️ IMMEDIATE ACTION REQUIRED ⚠️

Upon receiving this rule invocation:

  1. DO NOT ask for user input or confirmation before implementing code
  2. DO use the edit_file tool to create/modify the following files:
    • Primary implementation: pkg/razorpay/{resource_type}.go
    • Test implementation: pkg/razorpay/{resource_type}_test.go
    • Update toolset registration: pkg/razorpay/tools.go
    • Update the README.md

Read the full file on GitHub · 262 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 262 lines · 2,205 tokens per session scan A 5301d5352bbe

Subscribe to this mod's changes

new-tool-from-docs is a cursor rule published in the GitHub repository razorpay/razorpay-mcp-server (230 stars, last pushed 8d ago), licensed MIT. It adds 2,205 tokens to every session, about $0.0110 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.