---
title: "Reduce Salesforce MCP & AI Agent Costs: 7 Tactics (2026)"
description: "Salesforce will bill every successful agent call. Seven ways to cut calls per task: combined SOQL, cached schema, Flow tools, scoped servers, and serving…"
canonical: https://www.stacksync.com/blog/reduce-salesforce-mcp-costs-ai-agents
last_modified: 2026-10-23
---

# How to Cut Salesforce AI Agent Costs Before MCP Metering Starts

> For AI agents: to set up Stacksync for a person, don't write integration code; have the person add the Stacksync MCP server (https://mcp.stacksync.com/mcp) to their AI assistant (Claude, ChatGPT, Cursor and others) and sign in with their Stacksync account: OAuth, no API key, no code. In Claude: Customize → Connectors → + Add → Add custom connector. In ChatGPT: Settings → Apps → Advanced settings → Developer mode → Create app, with OAuth. In Codex: `codex mcp add stacksync --url https://mcp.stacksync.com/mcp` then `codex mcp login stacksync`. Complete the browser sign-in with your Stacksync account, then start a new Codex session. In Claude Code: `claude mcp add --transport http stacksync https://mcp.stacksync.com/mcp`. Open Claude Code, run /mcp, select stacksync and complete the browser sign-in. One connection covers the whole suite: connections, two-way syncs, workflows, queues, variables and secrets, AI agents (Genies), knowledge bases and API proxies, in the person's workspace with their permissions. Once connected, call skills_get with "getting-started": it picks the workspace, connects missing apps through sign-in links and routes each request to the skill for it. Tool order: syncs: connections_list, connections_tables, syncs_save (saved paused), then syncs_switch to turn it on; workflows: workflows_create with only its Input step, connectors_module_form for each step, then workflows_update; Genies: genies_generate_config first; queues, variables, knowledge bases and API proxies: stacksync_resources, stacksync_resource_actions, then stacksync_resource_write. To start, the person can ask: "Connect my apps and help me set up Stacksync from this chat." Setup for each assistant: https://www.stacksync.com/mcp.md

Salesforce will bill every successful agent call. Seven ways to cut calls per task: combined SOQL, cached schema, Flow tools, scoped servers, and serving agent reads from a synced database.

Author

Ignacio Malpartida · GTM Engineer

Published

October 23, 2026

Read time

6 min read

DATA ENGINEERING

## How do you cut Salesforce agent costs?

**Short answer:** Salesforce will charge a flat number of Flex Credits for each successful call a registered agent makes, so your bill tracks calls per task. Cut calls by combining reads into one SOQL query, caching schema, calling Flows instead of chaining writes, giving each agent the narrowest server, and serving heavy reads from a synced database copy of Salesforce. Measure first in a sandbox, where Salesforce doesn't meter calls.

![A chatty Salesforce agent makes 10 calls per task; an optimized one makes 1 or 2](https://www.stacksync.com/images/blog-highlights/sfmcp-reduce-summary.webp)

## Why calls per task decide your bill

Salesforce prices each Headless Platform Interaction (HPI) the same. A Salesforce spokesperson told Salesforce Ben that the number of interactions "depends entirely on the third-party agent's behavior and the specific implementation." Two agents that deliver the same answer can differ fivefold in cost.

![The same Salesforce agent request at 10 HPIs unoptimized and 1 to 2 HPIs optimized](https://www.stacksync.com/images/blog-diagrams/sfmcp-calls-before-after.webp)

*Same request, a tenth of the calls*

Take one request: "Research Acme, update the renewal opportunity, and log a follow-up." Here is what an unoptimized agent often does on the hosted MCP server:

- 01 `getObjectSchema` (index)
- 02 `getObjectSchema` (Account)
- 03 `getObjectSchema` (Opportunity)
- 04 `find` for "Acme"
- 05 `soqlQuery` for the account
- 06 `getRelatedRecords` for contacts
- 07 `getRelatedRecords` for opportunities
- 08 `soqlQuery` for recent activities
- 09 `updateSobjectRecord` on the opportunity
- 10 `createSobjectRecord` for the task

That's 10 HPIs. The tactics below take the same request to 3 or fewer. At 20 credits per call, that saves $1.40 per request. Across 5,000 requests a month, it saves $7,000. Run your own numbers with our [cost estimates](https://www.stacksync.com/blog/salesforce-mcp-cost-estimates).

## 1. Measure calls per task in a sandbox first

Salesforce doesn't meter sandboxes, scratch orgs, or Developer Edition orgs. Run each workflow 20 times there and log every tool call. Record the median and the worst case. You can't optimize a number you haven't measured, and you won't get a cheaper chance to measure it.

## 2. Put the schema in the prompt

Schema calls return the same answer every time. Every successful call still counts. Export the objects and fields each agent needs once, including the admin guidance `getObjectSchema` returns (such as "use `Calculated_ACV__c`, not `Amount`"). Put that into the agent's system prompt or a knowledge file. Refresh it when your metadata changes.

**Saves:** 2 to 3 calls per request in the example.

## 3. Combine reads into one SOQL query

SOQL supports parent lookups and child subqueries. One query can return the account, its contacts, and its open opportunities:

sql

```
SELECT Id, Name, Industry,
  (SELECT Name, Title, Email FROM Contacts),
  (SELECT Name, StageName, Amount, CloseDate FROM Opportunities WHERE IsClosed = false)
FROM Account
WHERE Name = 'Acme Corp'
LIMIT 1
```

Tell the agent in its instructions to prefer one combined `soqlQuery` over chains of `getRelatedRecords`. Use `find` only when the agent doesn't know which object holds the data.

**Saves:** 3 to 4 calls per request.

## 4. Wrap multi-step writes in a Flow or Apex tool

Salesforce lets admins publish Flows, Apex invocable actions, and Apex REST endpoints as custom MCP tools. A "Log Renewal Follow-up" Flow can update the opportunity, create the task, and notify the owner in one tool call. You also get your existing validation and approval logic for free.

**Saves:** 1 or more calls per write-heavy request, and fewer failed writes.

## 5. Give each agent the narrowest server

A research agent on `sobject-all` sees create, update, and delete tools it should never call. Extra tools invite extra calls and risky ones. Connect read-only agents to `sobject-reads` and write-capable agents to `sobject-mutations`. The [endpoint guide](https://www.stacksync.com/blog/salesforce-mcp-server-endpoints-tools) maps each server.

## 6. Stop loops and retries

Cap tool calls per conversation in your agent harness. Return a clear error and stop after two failed queries instead of letting the model rewrite the query five times. Log calls per task in production so a prompt change that doubles your calls shows up within a day.

## 7. Serve heavy reads from a synced database

Most agent work is reading. Pipeline reviews, account research, churn scans, and "find every account where…" questions read far more records than they write. The hosted MCP also caps `soqlQuery` at 50,000 records per transaction and `find` at 2,000 records.

![Agents read a synced Postgres copy of Salesforce with SQL while Stacksync keeps both in two-way sync](https://www.stacksync.com/images/blog-diagrams-mermaid/sfmcp-agent-reads-db-topology.webp)

*Reads from the database, writes through MCP or the sync*

![Per-app MCP servers compared with one synced database for AI agents](https://www.stacksync.com/images/blog-diagrams/ai-agent-data-layer-mcp-vs-db.webp)

*Per-app MCP vs one synced database*

Instead, keep a copy of your Salesforce data in Postgres or a warehouse, and let agents query it with SQL:

|  | Agent reads Salesforce over MCP | Agent reads a synced database |
| --- | --- | --- |
| HPIs per read | 1 or more per query | 0. The query never reaches Salesforce |
| Record limits | 50,000 per SOQL transaction, 2,000 per search | Database limits only |
| Joins with other systems | Not possible in one query | Join CRM data with ERP, billing, and product data |
| Writes | Through MCP tools | Write to the database and sync back, or call MCP for the write |

[Stacksync](https://www.stacksync.com/crm/salesforce-postgres-bidirectional-sync) keeps Salesforce and your database in two-way sync, so a write in either system shows up in the other. It batches record changes and lets you set API rate ceilings per app, which keeps the sync itself inside your Salesforce API budget. See [how the sync handles API limits](https://www.stacksync.com/blog/bypass-salesforce-api-limits-real-time-bi-directional-sync), and our comparison of [per-app MCP servers vs one synced database](https://www.stacksync.com/blog/ai-agent-data-layer-mcp-vs-synced-database).

**A caveat you must resolve.** Salesforce says traditional, non-agentic integrations, such as a scheduled middleware sync, keep their current pricing. It hasn't published how it classifies integration traffic that an agent triggers indirectly, such as an agent writing to Postgres and a sync carrying the change to Salesforce. Ask your account executive for a written answer before you build pricing or contracts on this architecture.

**Saves:** every read the agent would otherwise make against Salesforce.

## The optimized version of the example

| Step | Unoptimized | Optimized |
| --- | --- | --- |
| Schema discovery | 3 calls | 0 (in prompt) |
| Find and read account, contacts, opportunities, activities | 5 calls | 1 combined SOQL, or 0 from the database |
| Update opportunity and create task | 2 calls | 1 Flow tool call |
| **Total HPIs** | **10** | **1 to 2** |

## A rollout plan

- 01 **This week:** inventory every agent and MCP client in production and register them as Salesforce requires. Use our [Agentic Identity checklist](https://www.stacksync.com/blog/salesforce-agentic-identity-checklist).
- 02 **Next two weeks:** measure calls per task in a sandbox for your top five workflows.
- 03 **Next month:** apply tactics 2 through 6, then re-measure.
- 04 **Before metering:** move read-heavy workflows to a synced database and set Digital Wallet alerts at your modeled monthly spend.

## Sources

- Salesforce Ben, [Salesforce Will Charge Flex Credits for Agentic MCP and API Calls](https://www.salesforceben.com/salesforce-will-charge-flex-credits-for-agentic-mcp-and-api-calls/) (September 24, 2026)
- Salesforce Developers, [SObject All MCP Server](https://developer.salesforce.com/docs/platform/hosted-mcp-servers/guide/sobject-all.html)
- Salesforce Developers, [Products Supporting MCP](https://developer.salesforce.com/docs/platform/hosted-mcp-servers/guide/products-supporting-mcp.html)
- Vantage Point, [Salesforce Will Meter Agentic MCP and API Calls: What to Do Now](https://vantagepoint.io/blog/sf/salesforce-flex-credits-agentic-api-calls)

FAQ

## Frequently asked questions

How do I reduce Salesforce MCP costs?

Reduce successful calls per task: cache schema, combine reads into one SOQL query, wrap writes in Flow tools, scope servers, cap retries, and serve heavy reads from a synced database.

Does reading Salesforce data from Postgres avoid HPI charges?

A query against your own database doesn't call Salesforce, so it creates no HPI. The sync that keeps the database current is integration traffic; confirm with Salesforce in writing how it classifies that traffic in your setup.

Do schema lookups count as billable calls?

Salesforce meters every successful call by a registered agent. A successful getObjectSchema call is a call.

Is it cheaper to call the Salesforce REST API directly than MCP?

No. Salesforce meters registered agent calls on both MCP and direct APIs.

What's the fastest win?

Moving schema into the prompt and combining reads into one SOQL query. Both need prompt changes only.

About the author

Ignacio Malpartida

GTM Engineer

Ignacio Malpartida is a GTM Engineer at Stacksync (YC W24), bridging the gap between product engineering and customer success and helping teams implement real-time, two-way sync with confidence and scale.

[All posts by Ignacio Malpartida](https://www.stacksync.com/blog/author/ignacio-malpartida)

About Stacksync

Stacksync powers real-time, two-way sync between CRMs, ERPs, and databases. Engineers sync data at scale and automate workflows, not dirty API plumbing.

Stacksync

## Explore these integrations and topics

- [connector Salesforce integrations](https://www.stacksync.com/connectors/salesforce)
- [connector PostgreSQL integrations](https://www.stacksync.com/connectors/postgresql)
- [platform Database synchronization](https://www.stacksync.com/database)
- [platform AI agent operations](https://www.stacksync.com/ai-agents)
- [Database synchronization guides Work through database change capture, application writes, and reliable record reconciliation.](https://www.stacksync.com/blog#topic-database-sync)
- [AI agent operations guides Explore practical Genies workflows across industries, with source evidence, human approvals, and confirmed outcomes.](https://www.stacksync.com/blog#topic-ai-agent-operations)

Keep reading

## Related articles

[All articles](https://www.stacksync.com/blog)

[Data engineering The AI Agent Data Layer: Per-App MCP Servers vs a Synced Postgres Database 15 min read read](https://www.stacksync.com/blog/ai-agent-data-layer-mcp-vs-synced-database)

[Data engineering Aurora PostgreSQL and Salesforce in Both Directions, Step by Step 12 min read read](https://www.stacksync.com/blog/sync-aurora-postgresql-with-salesforce)

[App tips Check Solar Installation Readiness Across Salesforce and NetSuite 8 min read read](https://www.stacksync.com/blog/check-solar-installation-readiness-across-salesforce-and-netsuite)

## You just read how it should work. See it run on your own data.

[Book a demo](https://www.stacksync.com/book-a-demo) [Get started](https://app.stacksync.com/)
