create_mcptoken
Create a new MCP token for django-admin-mcp authentication, with optional user, permissions, groups, expiry, and inline rows.
Instructions
Create a new MCP Token, optionally with inline rows.
Date and datetime fields take a single ISO 8601 string (e.g. '2026-03-01' or '2026-03-01T09:30:00Z'). Foreign keys take the related object's ID, many-to-many fields a list of IDs. A field the admin form does not accept (unknown, read-only or non-editable) is rejected with an error, never ignored.
Fields:
id (BigAutoField)
name (CharField) [required]
user (ForeignKey) [required]
is_active (BooleanField)
created_at (DateTimeField)
expires_at (DateTimeField)
last_used_at (DateTimeField)
groups (ManyToManyField)
permissions (ManyToManyField)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | The data for the new MCP Token | |
| inlines | No | Inline rows to create with the object, keyed by inline model name: {model_name: [{data}, ...]}. All-or-nothing: any inline error rejects the whole call and nothing is saved |