Skip to main content
Glama

Create Records Run

create_records_run

Create a run that searches a data provider for people matching your criteria and CREATES them in the CRM -- contacts that do not exist there yet, each attached to its employer's account. If a person's employer is already an account, the contact is attached to it; if not, the account is created first, so this never duplicates an account you already have. THIS IS THE ONLY TOOL THAT ADDS RECORDS. Every other tool changes records that already exist, so this one takes no filter -- there is nothing to filter over. IT SPENDS MONEY when dispatched: one provider credit per contact created (record_cap is how many you want), and credit_cap, at least record_cap, is the most the whole run may spend: people it finds who moved are looked up for job changes with what the creates leave, and any past it are reported as not looked up. Searching is free. CALL list_search_criteria FIRST, the way a filter follows list_filterable_fields: the search schema names the criteria but not that a department is 'Engineering & Technical' rather than 'Engineering'. A wrong value in one of the six with a fixed vocabulary is refused HERE, naming what it should have been -- industry, job_function, management_level, department, company_type and has. A wrong free-text value (job_title, company_name, state, country, postal_code) cannot be checked against a list and is only discovered by the provider at DISPATCH, after the run exists. An unlisted criterion is always refused here. template_id names an ENRICHMENT configuration, which says where each provider field lands in the CRM; list them with list_rule_templates. It must map something to LastName (lastname on a HubSpot connection) or the run is refused, because a contact needs a last name. A lead run takes a LEAD configuration, which must also map Company; HubSpot has no lead to create. WITH A CLAY CONFIGURATION (one whose Clay function returns people for each company), the run searches nobody: send search as [] and name companies instead, CRM accounts by a filter or companies not in the CRM by id, name and domain. Each company is one row of the tenant's own Clay function, which decides who to return (the persona lives there); credit_cap is how many companies may be sent and record_cap how many people may be created. A person found at a CRM account is created under it.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "connection_id": "<connection_id>",
      "credit_cap": "<credit_cap>",
      "name": "<name>",
      "record_cap": "<record_cap>",
      "search": "<search>",
      "template_id": "<template_id>"
    },
    "name": "create_records_run"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesA name for the run, shown in the Runs tab. Dispatching this CREATES NEW RECORDS in the CRM and spends one provider credit for each.
searchYesWho to bring in, as rows of input/operator/value. Every row must hold (they are ANDed); several values in one row mean ANY of them. Call list_search_criteria for each input's operators and its exact vocabulary — the values that read most plausibly are often the ones this provider refuses. person_ids is exclusive: it NAMES people, so it cannot share a search with rows that describe a population. Specific people, by provider id (is) — free text Job title (contains/is exactly/is not) — free text; “is exactly” wants the WHOLE title character for character (“Vice President, Global Sales Operations”), so it usually finds nobody — “contains” is almost always what you want. Job function (is) — one of 186 values Management level (is/is not) — one of 6 values Department (is) — one of 11 values Industry (is/is primarily) — one of 180 values Company name (is) — free text Company, by provider id (is) — free text Company type (is) — one of 3 values State or region (is) — free text Country (is) — free text Postal code (is) — free text Has (is) — one of 5 values; several values mean ALL of them, so this input NARROWS. “email” is worth reaching for: barely half of any population has a business email Employees (at least/at most) — a whole number Revenue (at least/at most) — a whole number Contact accuracy (at least) — a whole number; 70 to 99
companiesNoOnly with a Clay configuration, and then required, with `search` empty: the companies to find people at, each sent to the configuration's Clay function, which returns the people. {"accounts": a filter over accounts} for CRM accounts (null for every account), or {"companies": [{"id", "name", "domain"}]} for companies not in the CRM. With Clay, credit_cap is how many companies may be sent, and record_cap how many people may be created.
tam_checkNoApply the connection's TAM to each person found before creating them: a person whose new contact, or whose employer account, would fall outside the TAM is not created and is reported with the criteria it failed. Their credit is already spent. Refused when the connection has no TAM. Subscription sets it, because its search is compiled from the TAM and can come back wider than it.
credit_capYesRequired: the most provider credits this run may spend in all, at least record_cap. Its creates spend first; people it finds who moved are looked up for job changes with what is left, and any past that are reported as not looked up.
record_capYesRequired: how many contacts to create. Each costs one Enrich credit; searching is free.
update_capNoHow many people the provider matches who are ALREADY contacts here may be refreshed with current data instead of skipped. 0 (the default) skips them and reports how many there were. Refreshing costs no credit; it bounds how long the run takes and how many records it writes. A plan that runs on a schedule must set it above 0, or every firing after the first finds the same people already known and does nothing for them.
dispositionNoWho releases this run's writes. 'execute' dispatches the pass on request, which is the default. 'queue' stamps the run awaiting_approval and launches nothing until a person approves it, which for this tool also means no provider credit is spent. There is no 'propose' here: a create run brings in records that do not exist yet, so a per-record proposal would name no CRM record and link to nothing a reviewer could open. Reviewing a create is reviewing the run.execute
object_typeNoWhich CRM object the run targets. Contact and Lead only — an account is minted as a CONTACT's parent when its employer is not already one, and never as the subject of its own run. A LEAD has no parent: its employer is the Company field, which its LEAD configuration must fill, as it must fill LastName.contact
template_idYesRequired: an enrichment configuration, by id (list_rule_templates), whose mapping decides which provider fields are written to each new contact. A field set to dont_update is not written.
scope_filterNoWith tam_check, the filter to check each new person against instead of the connection's TAM: {"account": a filter group over companies or null, "persona": a filter group over people or null}. A prebuilt plan scoped by a filter sets it.
connection_idYesThe CRM connection. Required. Call list_crm_connections to get one.
create_accountsNoCreate the person's employer as a new account when it matches no existing account. Default true; false leaves such contacts without an account.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / companies
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Only with a Clay configuration, and then required, with `search` empty: the companies to find people at, each sent to the configuration's Clay function, which returns the people. {\"accounts\": a filter over accounts} for CRM accounts (null for every account), or {\"companies\": [{\"id\", \"name\", \"domain\"}]} for companies not in the CRM. With Clay, credit_cap is how many companies may be sent, and record_cap how many people may be created.",
      +  "title": "Companies"
      +}
  2. Changed4 schema fields changed
    • changedInput schema / description
      Previous value: -"The Create run's create contract.\n\nsearch — the provider criteria, in this product's names (create/search.py). Required: a create run\n  with no criteria is a request for everybody, and the vendor refuses it too.\nrecord_cap — how many contacts to create, AND how much the run may spend, because they are the same\n  number: search is free and every record created costs exactly one Enrich credit. Required for the\n  reason the enrichment cap is required — it is the only field that decides how much money this\n  costs, so a person states it rather than discovering the scale of it from a bill.\ntemplate_id — an ENRICHMENT configuration, reused. A create mapping is provider-field-to-CRM-field,\n  which is an enrichment mapping with its `when` column removed: `when` decides what to do about a\n  value the CRM already holds, and on a create there is none. dont_update means the field is not\n  written; the other two both mean it is. One mapping concept, one authoring surface.\ncreate_accounts — mint the employer as an Account when the contact matches none. Defaulted true\n  because the alternative is contacts with no company, which is the state this tool exists to avoid.\n\nNO filter_spec, and its absence is the tool. Every other run scopes over records that exist; this one\nhas nothing to scope over, which is exactly why it is a separate tool rather than a mode."New value: +"The Create run's create contract.\n\nsearch — the provider criteria, in this product's names (create/search.py). Required: a create run\n  with no criteria is a request for everybody, and the vendor refuses it too.\nrecord_cap — how many contacts to create. Each costs one Enrich credit; search is free.\ncredit_cap — the most the run may spend on everything: its creates, and the job-change lookups for movers it\n  finds, which draw on what the creates leave (spend controls). Required, at least record_cap so the records\n  asked for can be paid for, and refused above the workspace's per-run maximum when one is set.\ntemplate_id — an ENRICHMENT configuration, reused. A create mapping is provider-field-to-CRM-field,\n  which is an enrichment mapping with its `when` column removed: `when` decides what to do about a\n  value the CRM already holds, and on a create there is none. dont_update means the field is not\n  written; the other two both mean it is. One mapping concept, one authoring surface.\ncreate_accounts — mint the employer as an Account when the contact matches none. Defaulted true\n  because the alternative is contacts with no company, which is the state this tool exists to avoid.\n\nNO filter_spec, and its absence is the tool. Every other run scopes over records that exist; this one\nhas nothing to scope over, which is exactly why it is a separate tool rather than a mode."
    • addedInput schema / properties / credit_cap
      Added value: +{
      +  "description": "Required: the most provider credits this run may spend in all, at least record_cap. Its creates spend first; people it finds who moved are looked up for job changes with what is left, and any past that are reported as not looked up.",
      +  "minimum": 1,
      +  "title": "Credit Cap",
      +  "type": "integer"
      +}
    • changedInput schema / properties / record_cap / description
      Previous value: -"Required: how many contacts to create, which is also the most this run may spend: searching is free and each contact created costs one Enrich credit."New value: +"Required: how many contacts to create. Each costs one Enrich credit; searching is free."
    • changedInput schema / required
      Previous value: -[
      -  "connection_id",
      -  "name",
      -  "record_cap",
      -  "search",
      -  "template_id"
      -]New value: +[
      +  "connection_id",
      +  "credit_cap",
      +  "name",
      +  "record_cap",
      +  "search",
      +  "template_id"
      +]
  3. Changed3 schema fields changed
    • addedInput schema / properties / create_accounts / description
      Added value: +"Create the person's employer as a new account when it matches no existing account. Default true; false leaves such contacts without an account."
    • addedInput schema / properties / record_cap / description
      Added value: +"Required: how many contacts to create, which is also the most this run may spend: searching is free and each contact created costs one Enrich credit."
    • addedInput schema / properties / template_id / description
      Added value: +"Required: an enrichment configuration, by id (list_rule_templates), whose mapping decides which provider fields are written to each new contact. A field set to dont_update is not written."
  4. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only say readOnlyHint=false and destructiveHint=false; the description supplies the cost model (one provider credit per contact, searching free, credit_cap vs record_cap, mover lookups drawing on the remainder), the duplicate-avoidance behavior for employer accounts, and the split between errors caught at creation (fixed vocabularies) versus errors only discovered at dispatch (free-text values). This is behavior an agent cannot get from the annotations.

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

Conciseness3/5

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

Front-loaded with purpose and cost, which is right, but the prose is dense and repetitive – credit_cap and record_cap are explained in the description and again in the schema, and the Clay branch is restated mid-paragraph. Capitalized emphasis phrases help scanning but add length; a tighter set of short paragraphs would preserve the content.

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

Completeness4/5

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

For a 13-parameter mutating tool with no output schema, the description covers cost, refusals, template requirements, Clay mode and dispatch semantics thoroughly. The remaining gap is what the call returns and how the run is tracked afterwards (which sibling like get_run or dispatch_run to use), which is left unstated.

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 coverage is 100%, so the baseline is 3, but the description adds meaning the schema does not: that six of the `search` inputs have fixed vocabularies whose values look plausible but are refused, that a department is 'Engineering & Technical' not 'Engineering', that template_id must map something to LastName or the run is refused, and that credit_cap must be at least record_cap. This meaningfully raises parameter understanding above the schema alone.

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?

States a precise verb and resource – a run that searches a provider for people and CREATES them in the CRM, attaching each to its employer's account. It also carves itself out from the family: 'THIS IS THE ONLY TOOL THAT ADDS RECORDS. Every other tool changes records that already exist,' which separates it from create_enrichment_run, create_job_change_run and the other run creators without needing their schemas.

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

Usage Guidelines5/5

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

Gives explicit prerequisites (call list_search_criteria first, as a filter follows list_filterable_fields; list_rule_templates for template_id; list_crm_connections for connection_id) and an explicit branch for Clay configurations where `search` must be empty and `companies` supplied instead. It also states what is refused and when, and distinguishes execute from queue dispatch.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.