Skip to main content
Glama
semwalajay83-sem

salesforce-metadata-mcp

Create Salesforce Custom Field

sf_create_custom_field
Idempotent

Create custom fields on Salesforce objects with support for Text, Number, Picklist, Lookup, and more. Specify field type, label, and API name ending in __c.

Instructions

Creates a new custom field on an existing Salesforce object. The field API name must end with '__c'. Supports all field types: Text, Number, Picklist, Lookup, etc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYesSalesforce field type
labelYesDisplay label for the field, e.g. 'Status'
scaleNoDecimal places for Number/Currency/Percent (0–17)
lengthNoMax length. Text/TextArea: 1–255 (default 255). LongTextArea/Html (Text Area Long / Rich Text Area): 256–131072 (default 32768).
uniqueNoWhether values must be unique (Text, Number, Email)
requiredNoWhether the field is required on page layouts
fieldNameYesAPI name of the field, e.g. 'Status__c'
precisionNoTotal digits for Number/Currency/Percent (1–18)
externalIdNoWhether this field is an external ID
objectNameYesAPI name of the parent object, e.g. 'Account' or 'Invoice__c'
descriptionNoOptional description for the field
referenceToNoTarget object API name for Lookup/MasterDetail, e.g. 'Account'
defaultValueNoDefault value for the field. Use true/false for Checkbox fields.
visibleLinesNoVisible lines. Required for LongTextArea and Html (Text Area Long / Rich Text Area) — default 10. Also used for MultiselectPicklist.
picklistValuesNoPicklist values. Either a plain list (['Draft','Open']) or the full { restricted, sorted, values } object. Required for Picklist / MultiselectPicklist types.
deleteConstraintNoDelete behaviour for Lookup fields: 'Cascade', 'Restrict', or 'SetNull'
relationshipNameNoAPI name for the relationship (no spaces)
relationshipLabelNoLabel for the relationship on the related object

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv3.2.0
    • removedInput schema / properties / picklistValues / additionalProperties
      Removed value: -false
    • addedInput schema / properties / picklistValues / anyOf
      Added value: +[
      +  {
      +    "items": {
      +      "anyOf": [
      +        {
      +          "maxLength": 255,
      +          "minLength": 1,
      +          "type": "string"
      +        },
      +        {
      +          "additionalProperties": false,
      +          "properties": {
      +            "color": {
      +              "description": "Hex color code, e.g. '#FF0000'",
      +              "pattern": "^#[0-9A-Fa-f]{6}$",
      +              "type": "string"
      +            },
      +            "default": {
      +              "default": false,
      +              "description": "Whether this is the default value",
      +              "type": "boolean"
      +            },
      +            "description": {
      +              "description": "Optional description for the value",
      +              "maxLength": 1000,
      +              "type": "string"
      +            },
      +            "fullName": {
      +              "description": "API name for the picklist value (e.g. 'New')",
      +              "maxLength": 255,
      +              "minLength": 1,
      +              "type": "string"
      +            },
      +            "isActive": {
      +              "description": "Whether the value is active (default true)",
      +              "type": "boolean"
      +            },
      +            "label": {
      +              "description": "Display label for the value",
      +              "maxLength": 255,
      +              "minLength": 1,
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "fullName",
      +            "label"
      +          ],
      +          "type": "object"
      +        }
      +      ],
      +      "description": "Either 'Value' or { fullName, label, ... }"
      +    },
      +    "minItems": 1,
      +    "type": "array"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "restricted": {
      +        "default": false,
      +        "description": "If true, only values in the list are allowed",
      +        "type": "boolean"
      +      },
      +      "sorted": {
      +        "default": false,
      +        "description": "Whether values are auto-sorted alphabetically",
      +        "type": "boolean"
      +      },
      +      "values": {
      +        "description": "List of picklist values",
      +        "items": {
      +          "$ref": "#/properties/picklistValues/anyOf/0/items"
      +        },
      +        "minItems": 1,
      +        "type": "array"
      +      }
      +    },
      +    "required": [
      +      "values"
      +    ],
      +    "type": "object"
      +  }
      +]
    • changedInput schema / properties / picklistValues / description
      Previous value: -"Picklist configuration. Required for Picklist / MultiselectPicklist types."New value: +"Picklist values. Either a plain list (['Draft','Open']) or the full { restricted, sorted, values } object. Required for Picklist / MultiselectPicklist types."
    • removedInput schema / properties / picklistValues / properties
      Removed value: -{
      -  "restricted": {
      -    "default": false,
      -    "description": "If true, only values in the list are allowed",
      -    "type": "boolean"
      -  },
      -  "sorted": {
      -    "default": false,
      -    "description": "Whether values are auto-sorted alphabetically",
      -    "type": "boolean"
      -  },
      -  "values": {
      -    "description": "List of picklist values",
      -    "items": {
      -      "additionalProperties": false,
      -      "properties": {
      -        "color": {
      -          "description": "Hex color code, e.g. '#FF0000'",
      -          "pattern": "^#[0-9A-Fa-f]{6}$",
      -          "type": "string"
      -        },
      -        "default": {
      -          "default": false,
      -          "description": "Whether this is the default value",
      -          "type": "boolean"
      -        },
      -        "description": {
      -          "description": "Optional description for the value",
      -          "maxLength": 1000,
      -          "type": "string"
      -        },
      -        "fullName": {
      -          "description": "API name for the picklist value (e.g. 'New')",
      -          "maxLength": 255,
      -          "minLength": 1,
      -          "type": "string"
      -        },
      -        "isActive": {
      -          "description": "Whether the value is active (default true)",
      -          "type": "boolean"
      -        },
      -        "label": {
      -          "description": "Display label for the value",
      -          "maxLength": 255,
      -          "minLength": 1,
      -          "type": "string"
      -        }
      -      },
      -      "required": [
      -        "fullName",
      -        "label"
      -      ],
      -      "type": "object"
      -    },
      -    "minItems": 1,
      -    "type": "array"
      -  }
      -}
    • removedInput schema / properties / picklistValues / required
      Removed value: -[
      -  "values"
      -]
    • removedInput schema / properties / picklistValues / type
      Removed value: -"object"
  2. First observedv2.8.5

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already disclose the write nature, idempotence, and non-destructive behavior. The description adds the '__c' naming constraint and the requirement that the object already exist, but it does not disclose permissions, failure modes, or what the response contains.

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?

Two concise sentences with the core purpose front-loaded. The 'all field types' phrase is somewhat redundant with the schema enum, but the overall description is efficiently sized.

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 18-parameter tool with no output schema, the description is minimally adequate: it gives the basic purpose and one important constraint, while the schema carries the rich parameter details. However, it leaves type-specific dependencies and the formula-field alternative unaddressed.

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 schema already documents all 18 parameters in detail. The description only repeats the API naming convention and gives type examples, adding little semantic value beyond the schema.

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: creates a custom field on an existing Salesforce object. It does not explicitly distinguish itself from the sibling sf_create_formula_field, and the claim 'Supports all field types' is broad given that Formula fields appear to be handled separately.

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?

Provides no explicit when-to-use or when-not-to-use guidance, and does not mention any alternative sibling tools. The only implicit cue is 'existing Salesforce object', which hints away from sf_create_custom_object, but no exclusions or routing conditions are stated.

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