AI columns and table recipes
Configure AI columns through LeadMagic MCP, review run costs, and share supported portable table recipes safely.
These tools configure supported columns. A manual run starts with run_sheet_column and any required approval; an existing approved AI auto-run can also start when rows or inputs change.
Start with LeadMagic Tables to find the table and inspect its column keys.
AI columns
An AI column evaluates one row at a time. Write prompts against the table's column names in braces, such as {Company Domain}. The name must match the column card from get_sheet; tool calls themselves use the column's stable key.
Draft and configure a prompt
Ask draft_sheet_ai_prompt for a starting prompt and output shape. It does not write to the table. Pass its proposed prompt and output type to add_sheet_columns or configure_sheet_column after reviewing them.
Configure a new AI column in one call, or use configure_sheet_column with an existing manual column's key:
For a categorical answer, pass at least two labels:
output_type accepts text, category, number, boolean, or json. categories is required for category and must contain at least two labels. allow_empty applies to categories; decimals applies to numbers and accepts 0–10. The prompt is required and can be up to 2,000 characters. The MCP column configuration schema does not accept email as an output type.
add_sheet_columns can configure up to 50 columns in order. A successful configuration only saves the action; it fills no cells and spends no credits. For new columns, the returned column_key is the key to use in run_sheet_column.
Choose a model and key
- LeadMagic AI
- Your own provider key
By default an AI column uses LeadMagic AI and its current default model. Leave provider and model out to follow that default; model availability and defaults can change. If you need a specific included model, use the current model choice offered in LeadMagic Tables rather than copying an old model id from an example.
LeadMagic AI model usage is charged in credits.
AI research tools and automatic runs
AI columns can optionally use web_search and selected leadmagic_tools for each row. The supported LeadMagic tools are email_validation, email_finder, personal_email_finder, profile_search, mobile_finder, role_finder, job_change_detector, email_to_b2b_profile, b2b_profile_to_email, company_search, company_funding, and technographics. They are per-row tool calls, with their usual credit costs. Web searches are also billed according to their actual cost.
The optional per-row controls apply only when web_search or leadmagic_tools is enabled:
| Input | Range | Default |
|---|---|---|
max_steps | 2–25 | 10 |
max_credits_per_row | 0–100 | 5 for the tool loop; a LeadMagic AI model step can add its own usage cost |
max_wall_seconds | 20–240 | 150 |
set_sheet_column_auto_run is limited to AI columns and workspace admins. Configuring an AI column does not turn automation on by itself; check the columns_to_fill result after adding rows for runs_automatically. rowAdded runs when new rows arrive; inputsChanged runs when a referenced input changes; manual turns automation off. Turning automation on requires max_credits and an approval token. It enables automatic runs for the table, so show the trigger and per-run credit ceiling and get the user's approval first. An already enabled AI auto-run can be triggered by new rows or edits to its inputs. Only AI columns can be configured for auto-run through this MCP tool.
Run the configured column
Use run_sheet_column after checking the inputs and requested output. It can run up to 10 columns together, and it orders columns that depend on other requested columns. Use sample_size for a small first pass when the prompt or output needs review. Runs costing 5 credits or less start immediately; a larger run returns the eligible rows, maximum credit quote, and a confirmation token. Show the quote, then resend the same arguments plus the token only after the user agrees. A pipeline can return next_step and next_arguments when a later dependent stage needs its own approval.
wait_seconds has a maximum of 45. If the response says a run is still active, use get_sheet_run or list_sheet_runs with a wait instead of rapidly polling. See table workflows for the full run flow.
Custom HTTP/API columns
The hosted public MCP does not expose tools for authoring, testing, saving, or running arbitrary HTTP requests, and it cannot import recipes that contain HTTP requests or webhook sources. Use the LeadMagic app to configure these integrations, or a separately configured agent that has access to the relevant app workflow. Do not ask the public MCP to call a generic vendor endpoint or to create/publish/run an HTTP-backed workflow.
The public MCP supports built-in LeadMagic enrichment, AI columns, formulas, and JSON field extraction. For those supported flows, see table workflows and the tool reference.
Portable table recipes
Recipes move a table's column configuration to a new workspace. They are a column manifest, not a copy of the table's data. export_sheet_recipe returns a JSON recipe and any warnings or omitted fields; it stores nothing. Review the exported document before sharing it.
Recipe columns use portable ref values (lowercase slugs) to link columns. Prompts and formulas keep using {Column Name} placeholders. The importer rebuilds the table-local column keys and account-bound connections, so never copy a col_… key or a workspace secret into a recipe.
An exported recipe may include connections and sources. Connections describe what an importer must reconnect; they never carry the publisher's saved key. For AI, an ai connection names a provider and label. The import call can map its ref to a vault_secret_id using ai_keys, or the user can connect the key in LeadMagic Tables. For a LeadMagic API key, leadmagic_keys maps a connection ref to a key id. Keep those ids within the appropriate authenticated MCP call; never include the secret value in a recipe or prompt.
For example, a BYOK AI recipe refers to a connection by ref; it does not embed a Vault key id:
On import, map my-ai to the destination user's saved key with ai_keys: {"my-ai": "<Vault key UUID>"}. Keep model configuration portable by omitting a pinned model unless the recipe specifically requires one supported by that provider.
The public MCP recipe tools support portable table configurations for supported column types. Recipes containing arbitrary HTTP requests or webhook sources are rejected; set up those integrations in the LeadMagic app instead. Never place credentials in a recipe.
Import creates a new table. It does not import rows or cell values, run columns, or carry the publisher's account credentials. After import, call get_sheet to get the new column keys, add the rows you intend to process, then explicitly run supported computed columns. Review a recipe before importing it.
See also
Table enrichment workflows
Build and enrich a LeadMagic table through MCP: map product inputs, preview a sample, run dependent columns, inspect outcomes, and retry selected rows.
Tables REST automation
Use the OAuth automation bridge to read and edit LeadMagic tables without an MCP client, with explicit operation batches, run quotes, idempotency, and workspace checks.
Was this page helpful?
We value your feedback.