Skip to main content
Glama

workspaces_segments_automations_create

Adds one automation (AI research, decision-maker finder, email finder, qualification, formula, API call...) to the segment. Get the config shape for the type from workspaces_enrichments_schema_retrieve. Context fields it writes are created if missing (as strings); declare them first with workspaces_context_fields_create to choose the type. Use run_filters to run it only on leads that pass given filters, which keeps paid steps cheap. It runs on new leads; for leads already in the segment, call segments_enrichments_run.

Method: POST /api/v1/workspaces/{workspace_sqid}/segments/{segment_sqid}/automations/

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": {
      "segment_sqid": "<segment_sqid>",
      "enrichment_type": "<enrichment_type>"
    },
    "name": "workspaces_segments_automations_create"
  }
}

Input Schema

NameRequiredDescriptionDefault
orderNoRun order within the segment. Lower runs first. Enrichments with output that feed others (e.g. KDM finder produces a person; AI research uses it) must come earlier.
configNoPer-enrichment-type config blob. Shape depends on `enrichment_type`. For the full schema of every type call `workspaces_enrichments_schema_retrieve` (returns form fields + types per enrichment). **`anyapi`** — runs a predefined or custom HTTP enrichment profile. Get available profiles via `workspaces_enrichment_profiles_list`; each profile exposes `input_fields`, `output_fields`, `settings_schema`. Config shape: ``` { "profile_sqid": "<sqid>", "settings": { "<setting_name>": "<value>", "use_predefined_<setting_name>": false }, "input_mapping": {"<input_field.name>": "<workspace_context_field.key>"}, "output_mapping": {"<output_field.name>": "<workspace_context_field.key>"} } ``` Example (ZeroBounce email validation): `{"profile_sqid": "…", "settings": {"api_key": "…"}, "input_mapping": {"email_address": "email"}, "output_mapping": {"status": "validation_status", "sub_status": "validation_detail"}}`. **Other types**: `ai_agent`, `kdm_finder`, `find_email`, `qualification`, `apply_formula`, `validate_phone`, `set_timezone`. Call `workspaces_enrichments_schema_retrieve` for their fields — each has its own form-derived shape, not the anyapi shape above. **`qualification`** — `write_role_relevance` defaults to `true` (left out = on): each qualified lead with an empty `role_relevance` gets one short AI call writing why the offer fits the person's job, which France, Finland, Canada, Australia and New Zealand require for named addresses. Send `false` to turn it off.
is_enabledNo
run_filtersNoOptional list of FilterConfig sqids — enrichment runs on a lead only if the lead matches every one of the listed filters (AND semantics). Use to cap cost (e.g. only enrich leads in your ICP). Empty list = run on every lead in the segment.
segment_sqidYes
allow_overwriteNoIf True, the enrichment overwrites existing values in its output context fields. If False, leads with existing data in those fields are skipped.
enrichment_typeYesWhich enrichment runs. One of: `anyapi`, `ai_agent`, `kdm_finder`, `find_email`, `qualification`, `apply_formula`, `validate_phone`, `set_timezone`, `domain_health`, `dns_query`, `validate_company`. The `config` blob shape depends on this — see `workspaces_enrichments_schema_retrieve` for per-type schemas.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose meaningful side effects: context fields are auto-created as strings if missing, and run_filters limits execution to matching leads to avoid paid steps. It does not cover permissions, error behavior, or what is returned by the POST, which keeps it short of a 5.

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?

Front-loads the core action and follows with prerequisites and the sibling alternative in a compact block; nearly every sentence carries information. The trailing HTTP method/path line is of marginal value to an agent already given the tool name.

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 7-parameter mutation tool with a nested polymorphic `config` and no annotations or output schema, the description covers the critical unknowns (config sourcing, context-field creation, lead scope). It still leaves the agent guessing about return value, failure modes, and defaults for order/is_enabled/allow_overwrite, though those are partly covered by schema descriptions.

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 71% and the schema is already detailed, but the description adds real value by pointing to `workspaces_enrichments_schema_retrieve` for the type-dependent `config` shape and by explaining the context-field side effect that drives output_mapping keys. It doesn't clarify order/is_enabled/allow_overwrite semantics in prose, but those are documented in the schema.

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 specific verb and resource ("Adds one automation ... to the segment") and enumerates the automation types, so an agent knows exactly what is created. It is clearly distinguishable from segments_enrichments_run, which the description names as the tool for leads already in the segment.

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 when-to-use routing: this tool applies to new leads, while `segments_enrichments_run` handles existing leads. It also names prerequisites (declare context fields with `workspaces_context_fields_create` first, fetch `config` shape from `workspaces_enrichments_schema_retrieve`) and a cost-control tactic (run_filters).

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.