Skip to main content
Glama
msicilia

mcp-server-redcap

by msicilia

add_field

Adds a new field to an existing REDCap instrument, updating the data dictionary with support for field types, validation, and branching logic.

Instructions

Add a new field to an existing instrument.

Exports the current data dictionary, inserts the new field, and imports the updated dictionary back. The operation is atomic from REDCap's perspective.

Args: form_name: Internal name of the instrument to add the field to. field_name: Variable name for the new field (lowercase, underscores, no spaces). field_type: One of: text, notes, calc, radio, checkbox, yesno, truefalse, select, slider, file, descriptive. field_label: Display label shown to data-entry users. choices: Choice definitions for radio/checkbox/select fields, formatted as "1, Label 1 | 2, Label 2". Ignored for other types. required: Whether the field must be filled before saving the record. branching_logic: Show/hide logic expression (e.g. "[age] > 18"). field_note: Helper text displayed below the field. section_header: Section header to display above this field. validation: Validation type for text fields (e.g. integer, number, date_ymd, email, phone). validation_min: Minimum allowed value (for validated text fields). validation_max: Maximum allowed value (for validated text fields). field_annotation: REDCap action tags and annotations (e.g. @HIDDEN). after_field: Insert the new field immediately after this field name. If None, the field is appended at the end of the instrument.

Returns: Confirmation message with the count of updated fields.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
choicesNo
requiredNo
form_nameYes
field_nameYes
field_noteNo
field_typeYes
validationNo
after_fieldNo
field_labelYes
section_headerNo
validation_maxNo
validation_minNo
branching_logicNo
field_annotationNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It explains the underlying process (exports data dictionary, inserts field, imports back) and notes the operation is atomic, giving insight into side effects and failure behavior. It stops short of detailing permissions or reversibility, but the atomicity note partially addresses that. This is substantially more transparent than typical descriptions.

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

Conciseness5/5

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

The description is structured with a clear purpose statement, a brief process explanation, and a well-organized Args list. Each parameter gets a concise, informative one-liner without redundant text. The length is justified by the 14 parameters, and the front-loaded purpose makes it scannable.

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

Completeness5/5

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

For a complex tool with 14 parameters, the description covers all necessary aspects: purpose, process, parameter semantics, and return value (confirmation message with count). The output schema is also available, so the description need not elaborate further on return structure. Given the complexity, this is highly complete.

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 description coverage is 0%, so the description must compensate. It does so exceptionally: every parameter is explained with meaning, formatting rules (e.g., field_name lowercase/underscores, choices format), and contextual notes (e.g., ignored for other types). This goes far beyond the schema's field names and types.

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 opens with 'Add a new field to an existing instrument,' which clearly states the specific action and target resource. This distinguishes it from related tools like add_instrument (adds an instrument) and update_field (modifies an existing field), making its purpose unambiguous.

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

Usage Guidelines4/5

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

The description provides clear context: it is for adding a new field to an existing instrument. It does not explicitly mention alternatives or exclusions, such as warning to use update_field for modifications, but the purpose is so direct that the intended usage is apparent. A brief note contrasting with update_field would elevate this, but current guidance is sufficient.

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/msicilia/mcp-server-redcap'

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