Skip to main content
Glama

export_laravel_models

Read-only

Generate Laravel Eloquent model classes from a DBML diagram, including fillable fields, casts, and inferred relationships. Export models for a saved diagram or unsaved DBML text.

Instructions

Generate Laravel Eloquent model files (fillable, casts, and inferred relationships including belongsToMany through plain pivot tables) for a diagram.

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": "export_laravel_models"
  }
}

Input Schema

NameRequiredDescriptionDefault
diagram_idNoA saved diagram to export (its UUID).
dbml_sourceNoOr export unsaved DBML text directly instead of a saved diagram.
laravel_versionNoTarget Laravel major version. 10 emits the legacy `protected $casts` property; 11+ emits the newer `casts(): array` method (not recognized by Eloquent 10).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.4

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so the safety profile is covered. The description adds genuine behavioral context by disclosing that relationships are inferred, including belongsToMany through plain pivot tables, but it never says whether files are written to disk or returned as text, nor how inference failures are handled.

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?

A single front-loaded sentence with no filler; the artifact list is dense but each item earns its place. Slightly overpacked, but nothing is redundant.

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

Completeness3/5

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

With no output schema, the description should clarify the return shape, and 'generate model files' leaves ambiguous whether the tool writes files or returns their contents. For a read-only export tool with fully documented parameters this is a moderate but real gap.

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

Parameters3/5

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

Schema description coverage is 100%, so all three parameters (diagram_id, dbml_source, laravel_version) are already documented in the schema, including the version-specific casts behavior. The description adds no parameter meaning beyond that, so the baseline 3 applies.

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 ('Generate Laravel Eloquent model files') and enumerates the generated artifacts (fillable, casts, inferred relationships including belongsToMany through plain pivot tables). It implicitly distinguishes itself from export_laravel_migrations by naming models rather than migrations, though it never names a sibling explicitly.

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

Usage Guidelines2/5

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

There is no when-to-use guidance: nothing says when to pick this over export_laravel_migrations or export_sql, and no prerequisites or exclusions are given. The only usage hint is the trailing 'for a diagram', which is implied rather than stated as a condition.

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