Rewrite Framework Code
rewrite_framework_codeApply conservative rewrites to update framework code (LangChain, LlamaIndex, Ollama, XRPL) to current APIs, returning a patched file and unified diff. Unsafe call-site transforms are left for manual handling.
Instructions
Apply conservative catalog rewrites (imports/identifiers) to a snippet and return the patched file plus a full unified diff. Use when review_framework_code found hits and you want an applyable file. Leftover lists unsafe call-site transforms (e.g. LLMChain(...)) that stay for a human/agent. Does not execute or submit. Paid tools/call: $0.001 USDC or 1000 drops XRP.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Source to lint before running. Not a stack trace (use diagnose_framework_error) | |
| filename | No | Optional path used only in unified-diff headers | |
| framework | Yes | One of langchain, llamaindex, ollama, or xrpl — the library the snippet is written against |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| diff | Yes | ||
| notes | Yes | ||
| applied | Yes | ||
| changed | Yes | ||
| filename | Yes | ||
| leftover | Yes | ||
| framework | Yes |