Skip to main content
Glama

add_component

Add an ELN form, container, or table component to the current form, with support for nested placement via parent path.

Instructions

向当前表单添加一个组件。支持完整的 ELN 组件体系:

  • 表单组件: Input, Number, TextArea, Select, DatePicker, DatePicker.RangePicker, TimePicker, TimePicker.RangePicker, Switch, Radio, Checkbox, Slider, TreeSelect, Cascader, Transfer

  • 容器/布局: Card, FormGrid, FormGrid.GridColumn, FormLayout, FormCollapse, FormCollapse.CollapsePanel, Space, Tabs, Tabs.TabPane

  • 表格类: Table, TableRow, TableCell, ArrayTable, ArrayTable.Column, ArrayTable.Index, ArrayFixTable, ArrayFixTable.Column, ArrayFixTable.RowTitle

  • 展示/数组: Text, FormattedText, ArrayCards 容器组件可包含子组件,通过 parentPath 指定父级路径。 详细属性配置请参考 Skill 文件: eln-component-catalog

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes字段标识(唯一),如 "sampleNo"。容器组件也需要唯一 name
typeYes组件类型,如 "Input", "Number", "Card"
titleYes显示标题,如 "样品编号"
displayNo是否显示
patternNo展示状态
requiredNo是否必填
parentPathNo父组件路径(如 "card1" 表示放在 card1 内部),不填则放在根级
componentPropsNo组件属性对象,如 { placeholder: "请输入", size: "default" }
decoratorPropsNo装饰器属性,如 { description: "辅助提示" }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior2/5

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

No annotations are present, so the description carries the full burden. It discloses that containers can hold children via parentPath, but does not mention side effects, validation rules, whether existing components are affected, permission requirements, or any reversible/irreversible nature. For a mutation tool with no annotation coverage, this is a significant gap.

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?

The description is well-structured with bullet lists and a clear opening sentence, but it is somewhat long (~150 chars). Each line earns its place, listing categories and the parentPath concept, plus a pointer to a skill file. No redundancy, though it could be trimmed slightly without losing information.

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?

For a complex tool with 9 parameters and no output schema, the description covers the main action and component types but omits return values, error conditions, and prerequisites like authentication (though login/check_auth siblings exist). The pointer to a skill file for detailed props is helpful, but the description alone leaves gaps in what the result of adding a component looks like.

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

Parameters4/5

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

Schema description coverage is 100%, setting a baseline of 3. However, the description adds genuine value by enumerating the valid values for the `type` parameter, which is a free-form string in the schema. This list (Input, Number, TextArea, etc.) saves agents from guessing or external lookups. Other parameters are not individually addressed, but the type enrichment is substantive.

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?

Opens with a specific verb and resource ('向当前表单添加一个组件'), and then enumerates the full component taxonomy (form, container, table, display), which cleanly differentiates it from siblings like remove_component, move_component, and copy_component. The mention of parentPath for nesting is distinctive to add operations.

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?

The description implies its use case ('向当前表单添加一个组件') but does not explicitly state when to prefer this over alternatives like copy_component or move_component for duplicates/existing components. No exclusions or conditional routing are provided, so the guidance is implicit rather than explicit.

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