Skip to main content
Glama

Lead Pipeline — Get Scoring Script (large pipelines)

lead_pipeline_get_engine
Read-only

For pipelines LARGER than 500 lead rows. Returns a complete, runnable Python script that loads the lead export in your sandbox and scores it locally (conversion probabilities, money layer, Shapley attribution, CALL / NURTURE / VERIFY queue). Makes no network calls — same shape as Customer Tiering — so Copilot Studio works even when outbound POST is blocked. The rows never pass through you as tokens. Needs numpy. Prints ranked decisions and headline figures; writes the full per-lead ledger to lead_pipeline_result.json. SAVE AND RUN THE RETURNED SCRIPT VERBATIM — do not retype, shorten, reformat, or reimplement it; only PATH / TOUCHES / STAGE_HISTORY / AS_OF / CURRENCY / OUT may be edited. Optionally takes touches_path and stage_history_path for engagement and funnel history.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
as_ofNoAnalysis date YYYY-MM-DD. Defaults to latest in file.
currencyNoISO currency code for display (INR, USD, EUR...).USD
file_pathYesPath to the lead export (CSV/TSV/JSON) inside your sandbox. Needs lead_id + created_date per row; optional stage, status, closed_date, deal_size, source.
touches_pathNoOptional path to a touch / activity log (lead_id, date, optional channel).
stage_history_pathNoOptional path to stage-change history (lead_id, date, stage).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
notesNo
scriptYesThe runnable scoring script.
currencyNo
languageNo
requiresNo
writes_fileNo
instructionsYes
code_integrityYes
engine_versionYes
file_path_usedNo
scipy_requiredNo
data_requirementsNo
touches_path_usedNo
network_access_requiredNo
stage_history_path_usedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • removedOutput schema / properties / feedback_prompt
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "additionalProperties": false,
      -      "properties": {
      -        "message": {
      -          "type": "string"
      -        },
      -        "must_ask": {
      -          "type": "boolean"
      -        },
      -        "output_count": {
      -          "type": "integer"
      -        },
      -        "reactions": {
      -          "items": {
      -            "additionalProperties": false,
      -            "properties": {
      -              "emoji": {
      -                "type": "string"
      -              },
      -              "label": {
      -                "type": "string"
      -              },
      -              "value": {
      -                "type": "string"
      -              }
      -            },
      -            "required": [
      -              "value",
      -              "emoji",
      -              "label"
      -            ],
      -            "type": "object"
      -          },
      -          "type": "array"
      -        },
      -        "ready": {
      -          "type": "boolean"
      -        }
      -      },
      -      "required": [
      -        "ready"
      -      ],
      -      "type": "object"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ]
      -}
    • removedOutput schema / properties / output_count
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "integer"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "description": "Successful scoring outputs since last feedback. Feedback is due at 3 and stays due until it is saved."
      -}
  2. Changed2 schema fields changed
    • addedOutput schema / properties / feedback_prompt
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": false,
      +      "properties": {
      +        "message": {
      +          "type": "string"
      +        },
      +        "must_ask": {
      +          "type": "boolean"
      +        },
      +        "output_count": {
      +          "type": "integer"
      +        },
      +        "reactions": {
      +          "items": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "emoji": {
      +                "type": "string"
      +              },
      +              "label": {
      +                "type": "string"
      +              },
      +              "value": {
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "value",
      +              "emoji",
      +              "label"
      +            ],
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "ready": {
      +          "type": "boolean"
      +        }
      +      },
      +      "required": [
      +        "ready"
      +      ],
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
    • addedOutput schema / properties / output_count
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Successful scoring outputs since last feedback. Feedback is due at 3 and stays due until it is saved."
      +}
  3. First observed

TDQS

A4.8/5.0
Behavior5/5

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

The description discloses that the tool makes no network calls, does not pass rows as tokens, requires numpy, writes to lead_pipeline_result.json, and must be run verbatim. This adds substantial context beyond the annotations (readOnlyHint=true, openWorldHint=true), covering side effects and operational requirements.

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?

The description is longer than ideal, but each sentence carries important operational detail (size threshold, network behavior, verbatim instruction, file output). It is well-structured and front-loaded with the key use case, though could be tightened by removing the repetition about row tokens.

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

Completeness5/5

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

Given the tool's complexity, the description is remarkably complete: it covers the purpose, output artifacts, constraints, dependencies, and exact usage instructions. The presence of an output schema means return values need no further explanation, and the description covers everything else an agent would need.

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 baseline is 3. The description adds value by explaining which parameters are safe to edit (PATH, TOUCHES, STAGE_HISTORY, AS_OF, CURRENCY, OUT) and noting that touches_path and stage_history_path are optional for engagement and funnel history, reinforcing schema semantics.

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?

The description clearly states the tool returns a runnable Python script for scoring large lead pipelines, with specific output (conversion probabilities, money layer, Shapley attribution, queue). It explicitly distinguishes itself from the sibling tool by targeting pipelines larger than 500 rows.

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?

The description opens with the explicit condition 'For pipelines LARGER than 500 lead rows,' and notes it is useful when outbound POST is blocked. This gives clear when-to-use guidance and implies the sibling handles smaller pipelines, though it doesn't name the sibling directly.

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