rails_get_callbacks
Retrieves ActiveRecord model callbacks grouped by type in Rails event order to reveal side effects, debug callback chains, and check save/create/destroy behavior; optional source code.
Instructions
Get ActiveRecord model callbacks grouped by type, in Rails event order: before/after/around for validation, save, create, update, destroy. Use when: understanding side effects, debugging callback chains, or checking what happens on save/create/destroy. Specify model:"User" for one model's callbacks. detail:"full" includes callback method source code. The list is what the model, its base classes and its concerns declare, and within one type the order is the order Rails runs them, a before_ or around_ callback with prepend: true first, and after_commit in the order the app's setting gives.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "rails_get_callbacks"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Model class name (e.g. 'User', 'Post'). Omit to see all models with their callbacks. | |
| detail | No | Detail level. summary: model names + callback counts. standard: callbacks by type in Rails event order (default). full: callbacks with method source code. |