Skip to main content
Glama

create_ioc_page

Generate Vue component code for the M8 low-code platform by executing npm run ioc create to automatically create directory structure and produce files following platform standards.

Instructions

【低码组件生成】生成符合 M8 低码平台规范的组件代码。

🔴 重要:此工具会自动在项目根目录执行 npm run ioc create 命令创建组件!

⚠️ 【最重要】优先使用 em-组件库!

  • 轮播/走马灯:必须使用 em-swipe + em-swipe-item,禁止自行实现轮播

  • 图片展示:必须使用 em-image(支持懒加载、失败占位)

  • 列表/单元格:使用 em-cell / em-cell-group

  • 按钮:使用 em-button

  • 弹窗:使用 em-popup / em-dialog

  • 标签:使用 em-tag

  • 下拉刷新:使用 em-minirefresh

  • 只有在组件库没有匹配组件时,才允许自定义实现!

📋 使用前必读 - 开发流程

  1. 指定项目路径:必须提供 project_path 参数,指向包含 package.json 的项目根目录

  2. 自动创建组件:工具会在项目目录下执行 npm run ioc create ComponentName 创建组件目录结构

  3. 返回生成代码:返回完善后的代码内容,由 AI 助手覆盖写入对应文件

  4. ⚠️ 必须检查 base.js:确保 module_name 与组件文件夹名一致,name 为组件中文名

📁 生成的目录结构(自动创建):

  • js/base.js(🔴 必须检查:name 中文名、module_name 必须=目录名、version)

  • js/config.js(属性/事件配置 - 含详细可配置项)

  • mock/data.js(模拟数据 - 需与 index.vue 的数据结构匹配)

  • index.vue(组件主文件 - 🔴 必须使用 em- 组件库)

  • css/index.scss(样式)

  • plugin/eventgenerate/index.js(事件生成插件)

  • plugin/boxoptions/config.js(容器配置插件)

  • index.js(组件注册入口)

📌 支持的配置项类型:

  • text: 文本输入

  • boolean: 开关

  • color: 颜色选择器

  • number: 数字输入

  • image: 图片URL

  • uploadimage: 图片上传(推荐)

  • select: 下拉选择

  • array: 数组配置(配合 dynamic:true 和 template)

💡 配置设计建议

  • 布局类:showTitle, showIcon, showBorder, layout, columns

  • 样式类:backgroundColor, titleColor, titleSize, borderRadius

  • 交互类:clickable, disabled, loading

  • 数据类:使用 array 类型支持动态列表

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathYes【必填】目标项目的根目录绝对路径,必须是包含 package.json 的目录。npm run ioc create 命令将在此目录下执行。例如:D:/projects/my-app 或 /home/user/my-app
component_nameYes组件名称,必须使用大驼峰命名法(PascalCase),如 ProductList、UserInfo、OrderDetail。此名称将用于:1. 组件目录名 2. js/base.js 中的 module_name
display_nameYes组件中文名称,将显示在低码平台中,如:商品列表、用户信息、订单详情
descriptionYes组件功能描述,详细说明组件的功能、UI 布局、交互逻辑
authorNo作者名称,默认 developer
config_optionsNo自定义属性配置项列表
custom_eventsNo自定义事件列表(除标准的 onMounted、onClick、onChange 外)
mock_data_structureNoMock 数据结构描述,如:包含 id、name、status、description 字段的列表
Behavior4/5

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

With no annotations provided, the description carries full burden and does well: it discloses that the tool automatically executes 'npm run ioc create' in the project root directory (a critical behavioral trait), warns about automatic component creation, and details the directory structure generated. It mentions important checks (e.g., base.js consistency) but doesn't cover error handling or rate limits, keeping it from a perfect score.

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

Conciseness3/5

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

The description is appropriately sized but not optimally structured: it uses emojis and sections (e.g., '重要', '使用前必读'), which aids readability, but includes extensive details like directory listings and configuration types that might be verbose. Some sentences (e.g., configuration design suggestions) could be trimmed for conciseness, though the front-loaded warnings are effective.

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?

Given the tool's complexity (8 parameters, no annotations, no output schema), the description is largely complete: it covers purpose, usage, behavioral traits, and process steps. However, it lacks details on return values or error handling, which are important for a tool that executes commands and generates code. The absence of an output schema means the description should ideally explain what is returned, but it only hints at '返回生成代码' (return generated code).

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 the baseline is 3. The description adds minimal parameter-specific semantics beyond the schema—it emphasizes project_path as '必填' (required) and links component_name to directory naming, but most parameter details (e.g., config_options types, mock_data_structure) are already well-documented in the schema. No significant value is added over the schema's thorough descriptions.

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

Purpose5/5

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

The description clearly states the tool's purpose: '生成符合 M8 低码平台规范的组件代码' (generate component code compliant with M8 low-code platform specifications). It specifies the verb ('生成' - generate) and resource ('组件代码' - component code), and distinguishes from siblings like create_page (likely for pages) and get_prompt/validate_code_standards (different functions).

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

Usage Guidelines5/5

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

The description provides explicit usage guidelines: it states when to use ('优先使用 em-组件库' - prioritize using em-component library), when not to use (only custom implementation when no matching component exists), and alternatives (specific em- components for various UI elements like em-swipe for carousels). It also outlines prerequisites like providing project_path and checking base.js.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lipeng9401222/m8-codex-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server