Prompts & Resources¶
Beyond tools, Django Admin MCP implements two more MCP primitives on the JSON-RPC endpoint: Prompts (reusable workflow guides) and Resources (read-only data access via URIs).
Prompts¶
Prompts help agents work with your admin effectively.
| Prompt | Arguments | Purpose |
|---|---|---|
explore_models |
— | How to discover models and browse data |
understand_model |
model_name |
Deep dive into one model's fields and admin config |
crud_guide |
model_name |
Safe create/update/delete practices, including inlines |
bulk_operations_guide |
— | Bulk tools, admin actions, and the confirmation flow |
# List prompts
curl -X POST https://example.com/mcp/ \
-H "Authorization: Bearer TOKEN" -H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "prompts/list"}'
# Get a prompt with arguments
curl -X POST https://example.com/mcp/ \
-H "Authorization: Bearer TOKEN" -H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 2, "method": "prompts/get",
"params": {"name": "understand_model", "arguments": {"model_name": "article"}}}'
An unknown prompt name or a missing required argument returns JSON-RPC error -32602. Prompts without arguments ignore any arguments passed.
Resources¶
Resources expose read-only data through URI schemes. Listings are filtered by the token's module and view permissions, and reads go through the same permission checks as the tools.
| URI | Content |
|---|---|
models://{model_name}/schema |
Field metadata and admin configuration |
data://{model_name}/ |
Paginated instance list (first 50) |
data://{model_name}/{id} |
A single instance by primary key |
# List available resources
curl -X POST https://example.com/mcp/ \
-H "Authorization: Bearer TOKEN" -H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "resources/list"}'
# Read a model schema
curl -X POST https://example.com/mcp/ \
-H "Authorization: Bearer TOKEN" -H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 2, "method": "resources/read",
"params": {"uri": "models://article/schema"}}'
Dynamic URIs are advertised via resources/templates/list.
Notes:
resources/listonly advertisesmcp_expose = Truemodels, butresources/readresolves any mixin-registered model (permission checks still apply) — mirroring howtools/listandtools/callbehave.- The
{id}segment ofdata://{model}/{id}is passed through as a string; extra path segments produce an error. - A missing
uriparameter returns JSON-RPC error-32602; read failures (unknown model, not found, permission denied) return-32002.
Action Confirmation Flow¶
Admin actions that render an intermediate confirmation page are supported with a two-step workflow:
- Call
action_<model>normally. If the action needs confirmation, the response containsrequires_confirmation: trueand the page content. - Call again with
confirm: true— the standard Django confirmation markers (post,confirm,apply) are set inrequest.POST. Extra form fields go inconfirmation_data.