Skip to main content
Glama

Create a custom field

sf_create_custom_field

Create a custom field on any Salesforce object using the Tooling API, with optional field-level security grants to profiles or permission sets.

Instructions

Create a custom field on an object via the Tooling API (POST /tooling/sobjects/CustomField), mirroring Inspector's Field Creator. Optionally grants field-level security to profiles/permission sets. Gated behind MC_NEXT_ALLOW_METADATA_CHANGES=true.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesField API name without the __c suffix, e.g. "Due_Date".
typeYesField type.
labelYesField label, e.g. "Due Date".
scaleNoDecimal places for numeric types.
lengthNoLength for Text/LongTextArea/Html.
sortedNoSort picklist values alphabetically. Default false.
uniqueNoMark the field unique. Default false.
grantToNoField-level security grants, applied after the field is created.
sobjectYesObject API name, e.g. "Account" or "Invoice__c".
requiredNoMark the field required. Default false.
precisionNoTotal digits for numeric types.
externalIdNoMark the field as an external id. Default false.
descriptionNo
defaultValueNoDefault value (e.g. true for a Checkbox).
visibleLinesNoVisible lines for long text areas.
inlineHelpTextNo
picklistValuesNoPicklist values, required for Picklist/MultiselectPicklist.
firstValueDefaultNoMake the first picklist value the default. Default false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations, the description carries the behavioral disclosure burden. It does disclose the endpoint, the metadata-change gate (MC_NEXT_ALLOW_METADATA_CHANGES=true), and optional field-level security grants. However, it omits side effects, permission requirements, and reversibility for this mutation operation.

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?

Three sentences, each carrying distinct information: the action and endpoint, the optional FLS behavior, and the required gate flag. It is front-loaded with the core purpose and contains no filler.

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?

The description is adequate for basic invocation, but with 18 parameters, no output schema, and no annotations, it should disclose more about expected responses, error conditions, and permission prerequisites. The gate flag and endpoint help, but an agent is left guessing about post-creation behavior.

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 89%, so the baseline is 3; the schema already documents most parameters well. The description adds value by mentioning field-level security grants, but it does not add parameter-level detail beyond what the schema provides.

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 uses a specific verb and resource: 'Create a custom field on an object' via the Tooling API. It names the exact endpoint and distinguishes this from sibling tools like sf_create_custom_object and sf_delete_custom_field. The reference to Inspector's Field Creator further clarifies intent.

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 clearly implies when to use this tool: when creating a custom field on an object. However, it does not explicitly state when not to use it or mention alternatives such as sf_create_custom_object for objects. The gating flag is a useful prerequisite but not a full usage guideline.

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