Back to Blog
Engineering

Build a Read-Only Sales Agent with Hyperleap MCP

Build a scheduled sales agent on Hyperleap's read-only MCP server: the agent loop, the tools it reads, copy-paste prompts, and an Anthropic SDK example.

Gopi Krishna Lakkepuram
May 27, 2026· Updated October 20, 2026
17 min read

TL;DR: A "sales agent" built on Hyperleap's MCP server is a non-interactive Claude run that wakes up on a schedule (or a trigger), reads your chatbot pipeline through the 9 read-only MCP tools, reasons over what it finds, and emits a structured output — a morning digest, a ranked follow-up queue, a loss-pattern summary. Because no Hyperleap MCP tool can create, change, or delete a lead, note, or stage, the agent observes but never edits your CRM, so a hallucinated argument produces a wrong answer, never corrupted data. This guide covers the agent loop, the read-only tool surface it draws on, copy-paste prompts, an Anthropic SDK example using Hyperleap's hosted MCP server, and how to schedule or event-trigger it with cron, Prefect, Temporal, or Airflow.

What "Sales Agent" Actually Means Here

The word "agent" is overloaded, so let's be precise. In this guide a sales agent is a non-interactive Claude run that you don't sit in front of. Where the patterns in our AI-native sales team guide describe a human asking questions in Claude Desktop, a sales agent removes the human from the loop for routine, repeating work. It runs on a schedule, calls the same Hyperleap MCP tools a person would, and hands you a finished artifact instead of a chat window.

It is the difference between asking "who came in overnight?" every morning and having a digest of exactly that waiting in your inbox at 7:30 AM — written by Claude, drawn from live pipeline data, with the three highest-intent leads already summarized.

One constraint shapes everything that follows: Hyperleap's MCP server is read-only. It exposes nine tools — leads, conversations, activities, notes, pipeline stages, dashboard metrics, and AI-extracted insights — and none of them can create, change, or delete a record. That is not a feature gap; it is the property that makes an unattended agent safe to run. You are letting Claude execute tool calls without a human reviewing each one, so the blast radius of a mistake matters. With a read-only surface, the worst an agent can do is read something it didn't need to. It cannot move a lead to the wrong stage, overwrite a note, or fire a downstream webhook.

Who This Guide Is For

Developers and RevOps engineers who already have the Hyperleap MCP server connected. If you haven't connected yet, start with Connect Hyperleap to Claude Desktop, then come back. Familiarity with the 9 MCP tools and basic Python is assumed.

The Agent Loop

Every useful sales agent reduces to the same four-phase loop. Keep this shape in mind — it's what you're implementing whether you run it from a shell script or a workflow orchestrator.

1. TRIGGER   →  cron schedule, webhook, or threshold crossing
2. GATHER    →  read-only MCP tool calls against Hyperleap
3. REASON    →  Claude synthesizes the gathered context
4. EMIT      →  structured output: email / team chat / file / ticket

Notice what is not in the loop: a write back to Hyperleap. The agent's job ends at EMIT. If a human (or a separate, write-capable system) needs to act on the output, that happens downstream — outside the read-only boundary. This separation is deliberate. It keeps the agent auditable: the MCP tool-call log is a complete record of every piece of data the agent touched, and you never have to ask "did it change a lead?" because it structurally cannot.

The GATHER phase is where the Hyperleap MCP tools do the work. A morning-digest agent gathers differently than a loss-review agent, but both compose the same primitives.

The Read-Only Tools Your Agent Will Use

You don't call these tools directly — Claude resolves your natural-language instruction to the right tool call. But you should know the palette so you can write instructions the agent can actually satisfy.

ToolWhat the agent readsTypical agent use
list_leadsLead list, newest first, filterable by stage, chatbot, tag, or search textThe entry point for almost every agent — scope the work
get_lead_detailsOne lead's full profile, with notes, insights, and recent activityEnrich a flagged lead before summarizing
get_lead_conversationsA lead's conversations with one chatbot (names, status, message counts)Find the conversation worth reading
get_conversationVerbatim transcript by IDPull exact quotes for a coaching brief
get_lead_activitiesActivity log, newest firstDetect "went silent after the proposal" patterns
get_lead_notesInternal team notesAvoid re-flagging a lead a rep already handled
get_pipeline_stagesStage definitions + lead countsOne-call pipeline snapshot; look up stage IDs
get_crm_dashboardAccount totals, new leads this week, stage and chatbot breakdownsHeadline numbers for a summary
extract_lead_insightsAI-extracted insights: topics, intent, sentiment, contact detailsThe high-leverage call — turn raw conversations into a decision

A note on extract_lead_insights: it runs an AI model over the lead's conversations, so it is the slowest call. It is also the one tool with a side effect: it saves the insights it finds to the lead's profile. Agents should reserve it for the handful of leads that clear an earlier filter — never run it across the whole pipeline. Leads that already have insights carry their top three in list_leads, so check those first. The API reference documents each tool's parameters and response fields in full.

No Write Tools Exist — Design For It

There is no create_lead, update_stage, or add_note in the Hyperleap MCP server. If your agent's job description includes "and then update the lead," that step lives outside the agent — in Hyperleap Studio or against the Hyperleap REST API. Don't write a prompt that asks the agent to perform a write; it has no tool to satisfy it.

Filters the Tools Don't Have

list_leads has no date, channel, or status filter. It returns leads newest first, and each lead carries CreatedAt and LastActivityAt, so "last 24 hours" means paging until leads get older than that. "Lost" and "Won" are pipeline stages: look them up with get_pipeline_stages. get_crm_dashboard takes no date range. The prompts below are written around these facts.

Three Agents Worth Building

Start with one. Get its output trustworthy, then add the next. Here are the three highest-value sales agents, each with the instruction you'd hand Claude.

Agent 1: The Morning Digest

Practical AI launch path from audit and preparation through testing and launch

The single most valuable agent for a founder or sales lead. Runs once a day before work, reads overnight pipeline movement, and emails a ranked brief.

You are a sales digest agent. Using the Hyperleap MCP tools, do the following:

1. Call get_crm_dashboard for the account totals and this week's new-lead
   count.
2. Call list_leads (it returns the newest leads first) and keep only the
   leads whose CreatedAt is within the last 24 hours. Fetch the next page
   only if every lead on the current page is that recent.
3. For the top 5 of those leads only, call extract_lead_insights to get
   their topics, intent, and sentiment.

Then write a digest with:
- A one-line pipeline summary (X new leads overnight, which chatbot brought
  in the most).
- A ranked list of the up-to-5 hottest leads. For each: name, what they
  asked about, inferred intent, and the single next step you'd suggest.

Keep it under 200 words. Do not invent leads or details not present in the
tool results. If fewer than 5 leads came in, only summarize what exists.

The "do not invent" guardrail matters more in an unattended agent than in a live chat, where a human would catch a fabrication. State it explicitly every time.

Agent 2: The Stalled-Lead Sweeper

Catches high-intent leads that have gone quiet — the leads most likely to be lost to neglect.

You are a pipeline-hygiene agent. Using the Hyperleap MCP tools:

1. Call get_pipeline_stages to find the "Proposal" stage ID.
2. Call list_leads with that stage ID. Each lead includes LastActivityAt.
3. For each lead whose last activity is more than 5 days old, call
   get_lead_notes to see if a rep has already logged a follow-up.

Output a table of leads where the last activity is more than 5 days old AND
there is no follow-up note from the last 5 days. Columns: lead name, days
since last activity, latest note (if any), what they asked about (from their
top insights). If the list is empty, say "No stalled leads — pipeline is
clean."

Swap "Proposal" for whichever stage means "hot" in your pipeline. This agent reads get_lead_notes specifically to avoid nagging about a lead a rep already worked — the kind of context a naive filter would miss.

Agent 3: The Weekly Loss-Pattern Brief

Runs every Friday, reads the week's lost leads, and finds the recurring reason.

You are a win/loss analyst agent. Using the Hyperleap MCP tools:

1. Call get_pipeline_stages and find the stage marked as closed-lost.
2. Call list_leads with that stage ID. For each lead, call
   get_lead_activities and keep the leads that moved into that stage this
   week. Stop after 15 leads.
3. For each lost lead you kept, call get_lead_conversations (using the
   lead's ChatbotId) and get_conversation on their most recent conversation
   to read what they originally asked about.

Synthesize a single paragraph: how many leads were lost, the most common
point at which they went silent (e.g., after the proposal, after pricing),
and the two most frequent objection themes — quoting actual phrasing where
the transcripts support it. Flag any lead that was lost with no recorded
follow-up note. Ground every claim in the tool results.

Always Cap the Batch Size

Unattended agents can page through your entire lead database if you let them — burning time and tokens. Put an explicit ceiling in every instruction ("top 5 leads," "stop after 15"). The agent has no human watching the call count, so the limit has to live in the prompt.

Building It With the Anthropic SDK

Claude Desktop is for the human-in-the-loop workflows. For a scheduled agent you run Claude non-interactively through the Anthropic SDK and attach Hyperleap's hosted MCP server with the Messages API's MCP connector. Anthropic connects to https://api.hyperleapai.com/mcp on your behalf, so there's no MCP process to run on your side.

Authenticating an Unattended Run

Hyperleap's MCP server uses OAuth. The connector needs an access token, and access tokens last an hour, so a scheduled job works from a refresh token:

  1. Create an MCP key for the agent. In Hyperleap Studio, open your profile menu → My MCP Keys → Create MCP Key, and name it something like sales-agent.
  2. Sign in once to get a refresh token. Run the OAuth flow one time with a tool that shows you the tokens it receives (the MCP Inspector's OAuth tools can do this), or with a short script against the endpoints in the API reference. Paste the agent's MCP key when the Connect to Hyperleap AI page asks for it.
  3. Store the refresh token as a secret. Refresh tokens last 90 days, and every refresh returns a new one, so save the new token after each run.

The Agent Skeleton

Here is the minimal skeleton — one agent, one run.

import os

import anthropic
import requests

# Exchange the stored refresh token for a fresh access token (valid for 1 hour).
token = requests.post(
    "https://api.hyperleapai.com/mcp/token",
    data={
        "grant_type": "refresh_token",
        "refresh_token": os.environ["HYPERLEAP_MCP_REFRESH_TOKEN"],
    },
    timeout=30,
)
token.raise_for_status()
tokens = token.json()
save_refresh_token(tokens["refresh_token"])  # your secret store: the old one no longer works

client = anthropic.Anthropic()

DIGEST_INSTRUCTION = """
You are a sales digest agent. Using the Hyperleap MCP tools, summarize the
leads that came in over the last 24 hours. Call get_crm_dashboard for the
headline numbers, list_leads for the newest leads, and extract_lead_insights
on the top 5 only. Return a ranked brief under 200 words. Do not invent any
lead or detail not present in the tool results.
"""

response = client.beta.messages.create(
    model="claude-opus-5-5",
    max_tokens=16000,
    betas=["mcp-client-2025-11-20"],
    mcp_servers=[
        {
            "type": "url",
            "url": "https://api.hyperleapai.com/mcp",
            "name": "hyperleap",
            "authorization_token": tokens["access_token"],
        }
    ],
    tools=[{"type": "mcp_toolset", "mcp_server_name": "hyperleap"}],
    messages=[{"role": "user", "content": DIGEST_INSTRUCTION}],
)

digest = "".join(
    block.text for block in response.content if block.type == "text"
)
print(digest)
# → hand `digest` to your EMIT step: send_email(...), post_to_team_chat(...), etc.

The MCP Connector Is a Beta — Verify Before Shipping

The MCP connector is a beta feature of the Anthropic API. The mcp-client-2025-11-20 beta and the paired mcp_servers + mcp_toolset shape above match Anthropic's current documentation, but betas change. Check the Anthropic MCP connector documentation before deploying.

The EMIT step is intentionally outside the SDK call. The agent produces text; what you do with that text — email, a team-chat post, a Markdown file, a ticket — is plumbing you own. Keep it separate so the read-only reasoning stays cleanly testable.

For production, wrap the run in error handling for the token refresh and the API call, and keep the response: each Hyperleap tool call appears in it as an mcp_tool_use block followed by an mcp_tool_result block. That record is your audit trail — it shows exactly which leads and conversations the agent read.

Scheduling and Triggering the Agent

The agent loop's TRIGGER phase is where you decide when the run fires. Two families: time-based and event-based.

Time-Based: Cron and Orchestrators

Layered AI safeguards across access, data scope, guardrails, audit trail, and human review

The simplest trigger is a cron entry that runs your script on a cadence:

# Morning digest, every weekday at 7:30 AM
30 7 * * 1-5  /usr/bin/python3 /opt/agents/morning_digest.py

For anything beyond a single script you want a real orchestrator — Prefect, Temporal, or Airflow. They give you retries, observability, alerting on failure, and the ability to chain the agent's output into a downstream task (the EMIT step, or a human-review gate). A Prefect flow, for example, would wrap the token refresh and the SDK call as one task and the notification as the next, with the framework handling retry-on-failure between them. The agent logic doesn't change — only the harness around it.

Event-Based: Threshold Triggers

The higher-leverage pattern is triggering on a signal rather than a clock. If your plan includes webhooks (Pro and Max), Hyperleap's lead-captured webhook is the cleanest trigger: run the agent when a new lead arrives. Without webhooks, a lightweight watcher can poll list_leads on a tight schedule and look only at leads newer than its last run. Either way, the agent runs extract_lead_insights on the new lead and fires the full synthesis only when the insights show strong buying intent — so the expensive work happens only when there's something worth synthesizing.

This is the same agent pattern described in our multi-MCP workflows guide — only the trigger mechanism changes. In that guide the agent fans out to write-capable servers (HubSpot, Linear) after reading Hyperleap. Here we keep it read-only and emit a notification instead. Both are valid; the read-only single-server version is the safer starting point.

Start Read-Only, Add Writes Deliberately

Ship the read-only agent first. Once you trust its output for a week or two, then decide whether to wire its EMIT step into a write-capable system — and when you do, put a human-review gate between "agent decided" and "write executed." The read-only Hyperleap surface stays your stable, safe foundation no matter how far you extend the EMIT side.

Guardrails for Unattended Runs

Three failure modes matter more when no human is watching:

Hallucinated content. In a live chat you'd catch a made-up lead. An agent emits straight to your inbox. Mitigation: the explicit "ground every claim in the tool results" instruction in every prompt, plus a sanity check in code (e.g., the leads named in the digest should appear in the list_leads results recorded in the response).

Prompt injection through conversation content. Your agent reads chatbot transcripts written by end users. A malicious visitor could embed "ignore previous instructions" text in a conversation. The defense is structural: Hyperleap's read-only design means even a successful injection cannot make the agent change your CRM — the worst case is a garbled summary, not a corrupted pipeline. Treat all conversation content as untrusted and never wire a read-only agent's raw output directly into a write action without review.

Runaway call volume. An agent paging through the whole database wastes tokens and can trip the API's request-rate limit. Mitigation: batch caps in the prompt (covered above), and a schedule that leaves room between runs. If a run does hit the limit, retry it later rather than in a tight loop.

Build Your First Sales Agent on Hyperleap MCP

Every paid Hyperleap plan includes the read-only MCP server — 9 tools, nothing it can overwrite. Connect it to Claude and ship a morning-digest agent this week.

See Plans

Frequently Asked Questions

Can a Hyperleap MCP agent modify my CRM data?

No. None of the 9 tools can create, update, or delete a lead, note, pipeline stage, or conversation, which is the property that makes unattended agents safe to run. The one side effect is that extract_lead_insights saves the insights it extracts to the lead's profile. If your workflow needs to write back (update a stage, add a note, send a message), that step happens outside the MCP boundary — in Hyperleap Studio or through the REST API — ideally behind a human-review gate.

Do I need a paid plan to build agents on the MCP server?

Yes. The MCP server is included on every paid Hyperleap plan — Plus, Pro, and Max — and isn't gated behind a higher tier. There is no free plan. Agents sign in with OAuth: create a personal MCP key for the agent from your profile menu in Studio, sign in once, and store the refresh token the agent uses for each run.

How is this different from just asking Claude Desktop questions?

Claude Desktop is interactive — a human asks, reads, and decides in real time. A sales agent removes the human from routine, repeating work: it runs on a schedule or trigger, calls the same read-only MCP tools, and emits a finished artifact (a digest, a queue, a brief) without anyone sitting in front of it. The tool surface is identical; what changes is that the run is unattended, which raises the bar on guardrails like batch caps and "ground every claim" instructions.

Which scheduler should I use to run the agent?

For a single daily run, a plain cron entry calling your Python script is enough. For anything with retries, failure alerting, or multi-step chains (agent run → notification → review gate), use a workflow orchestrator — Prefect, Temporal, or Airflow. The agent logic is identical across all of them; the orchestrator only wraps the TRIGGER and EMIT phases. For event-based runs, a webhook or a lightweight watcher that fires the full agent only when a new lead shows strong intent is more efficient than a fixed clock.

How do I keep the agent from making too many calls?

Two layers. First, cap the batch in the prompt — "top 5 leads," "stop after 15" — so the agent never pages through the entire database. Second, reserve the slow extract_lead_insights call for the handful of leads that clear an earlier, cheaper filter rather than running it across the pipeline. The API applies a request-rate limit to every client; a capped, scheduled agent stays well clear of it.

Can I extend a read-only agent to take actions later?

Yes, and the recommended path is to do it deliberately. Ship the read-only agent first and trust its output for a couple of weeks. Then, if you want it to act, route its EMIT step into a write-capable system — and put a human-review gate between the agent's recommendation and any write. The multi-MCP workflows guide shows the pattern for combining Hyperleap's read-only server with write-capable servers like HubSpot and Linear. Hyperleap stays the read-only foundation; the write capability lives in the systems you've explicitly granted it to.

Related Articles

Gopi Krishna Lakkepuram

Founder & CEO

Gopi leads Hyperleap AI with a vision to transform how businesses implement AI. Before founding Hyperleap AI, he built and scaled systems serving billions of users at Microsoft on Office 365 and Outlook.com. He holds an MBA from ISB and combines technical depth with business acumen.

Published on May 27, 2026 · Last updated October 20, 2026

Explore Hyperleap AI

An AI front desk that answers customer questions, collects contact details, and books appointments on your website and messaging channels.