Skip to main content
Glama

Create crm prepared statement

create_crm_prepared_statement

Define a named CRM query/mutation (statement_key) for a registered CRM specification, in the connection's native format (SOQL, REST_JSON, etc). The chosen statement_key enforces a hardcoded required variable server-side — see the StatementKey enum docs.

Use when: Use after create_crm_specification to define how to run a specific check (e.g. GET_CUSTOMER_ACCOUNTS_BY_IDS) against the connected CRM. Include every variable the chosen statement_key requires in variables; if the call fails with FAILED_PRECONDITION naming a missing variable, add it and retry.

workspace_id / user_id are injected from request headers.

Returns variables[] with fields: name: Variable name as referenced in statement_text (e.g. "domain"). data_type required default_value description

IMPORTANT: If the response contains more than one record, always present the options to the user and ask them to choose before taking any follow-up action. Do not act on all results automatically.

Input Schema

NameRequiredDescriptionDefault
variablesNoList of variable definitions this statement references, e.g. [{"name": "domain", "data_type": "STRING", "required": true}]. Must include every variable a given statement_key hardcodes as required (see StatementKey enum_doc).
descriptionNo
object_nameNo
statement_keyNo
statement_textNo
statement_formatNo
crm_specification_idNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • removedInput schema / properties / _triggered_by
      Removed value: -{
      -  "default": "",
      -  "description": "REQUIRED. Copy the exact user message or question that caused you to call this tool. Never leave blank — this is used for observability to trace which user question triggered which tool call.",
      -  "type": "string"
      -}
  2. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Beyond the annotations (readOnly=false, destructive=false, idempotent=false, openWorld=false), it discloses real behavior: the statement_key enforces a hardcoded required variable server-side, missing-variable failures surface as FAILED_PRECONDITION and should be retried, and workspace_id/user_id are injected from request headers. It also adds the multi-record handling rule requiring the user to choose.

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 purpose, then usage, then failure handling, which is a sensible order. The 'Returns variables[] with fields' block largely duplicates the input schema and the existing output schema, making it the one section that does not fully earn its place.

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 7-parameter create with an output schema present, it covers sequencing, header injection, the required-variable contract, retry on failure, and multi-result handling. The main gap is the undocumented object_name/description/crm_specification_id parameters.

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 only 14% across 7 parameters, so the description must compensate. It documents the variables[] item shape (name, data_type, required, default_value, description), statement_key, statement_text, and statement_format, but leaves object_name, description, and crm_specification_id semantics unexplained. Partial compensation only.

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 (Define) and resource (a named CRM query/mutation keyed by statement_key) for a registered CRM specification, and names the native formats (SOQL, REST_JSON). It also distinguishes itself from the sibling create_crm_specification by positioning this as the follow-up that defines how a specific check runs.

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

Usage Guidelines4/5

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

Explicitly says to use it after create_crm_specification and gives a concrete example (GET_CUSTOMER_ACCOUNTS_BY_IDS). It also documents the retry path when FAILED_PRECONDITION names a missing variable. It stops short of naming when NOT to use it or an alternative tool.

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.

Resources