Skip to main content
Glama

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

NameRequiredDescriptionDefault
dataYesThe data for the new MCP Token
inlinesNoInline 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

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden and does well: it discloses the atomicity guarantee ('any inline error rejects the whole call and nothing is saved') and the rejection behavior for non-editable fields ('rejected with an error, never ignored'). It falls short of stating auth requirements or the response format, but the mutation semantics are notably well covered.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core action, then the input-format contract, then a structured field list. The field enumeration is dense but earns its place by documenting the otherwise opaque nested 'data' payload.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 2-param, nested, no-annotation, no-output-schema create tool, the description covers fields, formats, and error/atomicity semantics adequately. Gaps are the response shape and permission requirements, which are minor given no output schema exists to describe.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3, but the description adds substantial value beyond the schema's bare 'data' object: it enumerates each field with its type, marks name and user as required, and defines encoding rules for datetime (ISO 8601 string), foreign keys (ID), and many-to-many (list of IDs). This meaningfully explains what must be packed into the opaque 'data' object.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: 'Create a new MCP Token', with the additional scope of optionally creating inline rows. It is clearly distinguishable from the sibling update/get/list/delete_mcptoken tools by the 'Create' verb, though it does not explicitly contrast itself with update_mcptoken or bulk_mcptoken.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by the create verb and the 'optionally with inline rows' phrasing, which hints that inlines are the mechanism for nested creation. However, there is no explicit guidance on when to prefer this over update_mcptoken, bulk_mcptoken, or how to know inlines are needed.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.