Tool Masking for Enterprise Agentic AI Systems at Scale

databook · Tech · 2025 · source Agentic: yes · promotional bias: med · source-backed · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Enterprise agent tool interfaces

Databook needed reliable enterprise-scale sales agents, but MCP-connected services exposed full APIs and bloated tool schemas that increased cost, token load, and model choice entropy.

Constraints:

Architecture

Databook inserted a tool masking layer between agents and raw tool handlers. The raw handler or MCP service remains available underneath, while tool masks reshape input and output schemas, filter irrelevant fields, and customize the tool surface for each agent context so agents see a small, task-appropriate interface.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  enterprise_sales_agent["Enterprise sales agent"] --> tool_mask_layer["Tool mask layer"]
  customer_specific_configuration["Customer-specific configuration"] --> tool_mask_layer
  tool_mask_layer --> raw_tool_handler["Raw tool handler"]
  raw_tool_handler --> external_service_apis["External service APIs"]
  external_service_apis --> raw_tool_handler
  raw_tool_handler --> tool_mask_layer
  tool_mask_layer --> enterprise_sales_agent
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Enterprise sales agent Runs sales intelligence and workflow automation for enterprise customers. Tool mask layer
Tool mask layer Filters, reshapes, and customizes tool schemas and responses for a specific agent context. Enterprise sales agent, Raw tool handler, Customer-specific configuration
Raw tool handler Exposes full service or API surfaces, potentially through MCP. Tool mask layer, External service APIs
External service APIs Provide underlying business data such as finance or sales information. Raw tool handler
Customer-specific configuration Allows masks to adapt tool surfaces and outputs for different customer requirements. Tool mask layer

Data flow

An agent calls a masked tool interface. The mask constrains the input schema and requested data, forwards the call to the underlying handler or MCP-connected service, filters and reshapes the raw response, then returns a smaller context-specific result to the agent.

3 supporting quotes
“Their solution involved implementing "tool masks"—a configuration layer between agents and tool handlers that filters and reshapes input/output schemas”summary, stated
“At the bottom layer sits the tool handler—what MCP exposes or what the service itself exposes. This contains the full raw surface of the tool”summary, stated
“On top of this handler, they run ma”summary, stated

Why this architecture

The mask layer keeps MCP's connectivity benefits while preventing raw APIs from overwhelming the LLM with irrelevant fields and excessive choices.

“MCP excels at standardizing connections across services and is gaining wide adoption, but it doesn't filter the tool surface that gets exposed to agents.”summary, stated
“The goal is to minimize unnecessary tokens, exclude unrelated information, and reduce choice entropy to improve reliability.”summary, stated

Models used: LLM agents · MCP-connected tools

Scale

Alternatives considered (roads not taken)

Expose full MCP service surfaces directly to agents

Rejected because: It pollutes the prompt with irrelevant data and increases token cost and choice entropy.

“When any service is connected through MCP, it typically exposes the entire API or service surface to the LLM without any filtering or optimization.”summary, stated

Let raw API responses flow into prompts

Rejected because: Large irrelevant response fields bloat prompts and degrade accuracy.

“the prompt becomes bloated with irrelevant data, unnecessary tokens are processed, and accuracy demonstrably degrades.”summary, stated

Patterns

tool-use-orchestration (agent tools)

Databook controls the tool interface exposed to agents through masks placed above raw handlers.

“Databook's solution involves introducing a "tool masking" layer between agents and the underlying tool handlers. This architecture has three primary components:”summary, stated

context-engineering (tool context)

Tool masks reduce irrelevant input and output context before it reaches the model.

“First, agents work best with clean, focused inputs and clear expectations for outputs—when these conditions are met, consistency, accuracy, quality, speed, and cost all improve.”summary, stated

cost-aware-routing (token control)

Filtering tool payloads reduces unnecessary tokens and cost in agent execution.

“When building long-running production workflows for large tech companies, Databook needed to ensure these systems work reliably, produce consistent results at volume, maintain quality, and optimize costs simultaneously.”summary, stated
“The goal is to minimize unnecessary tokens, exclude unrelated information, and reduce choice entropy to improve reliability.”summary, stated

Tradeoffs

Keep MCP or raw handlers underneath a mask layer.

Chose Masked tool interfaces over raw tool exposure over Direct agent access to entire APIs.

Rationale: The mask keeps connectivity while making the model-facing interface focused and reliable.

“At the bottom layer sits the tool handler—what MCP exposes or what the service itself exposes. This contains the full raw surface of the tool, including complete API input and output objects. This layer remains constant and could be MCP-based or not.”summary, stated
“On top of this handler, they run masks.”summary, stated

Prompt-engineer tool schemas, not just model prompts.

Chose Customized tool input and output schemas per context over One universal raw tool interface.

Rationale: Task-specific schemas reduce choice entropy and improve speed, cost, and reliability.

“customizes tool interfaces per agent context, and enables prompt engineering of tools themselves.”summary, stated

Gotchas (what bit them)

MCP connectivity can expose too much tool surface.

Root cause: The protocol standardizes access but does not filter APIs for each agent's task.

Resolution: Add tool masks that reshape schemas and outputs per agent context.

“MCP excels at standardizing connections across services and is gaining wide adoption, but it doesn't filter the tool surface that gets exposed to agents.”summary, stated

More tool choices create more model failure modes.

Root cause: Large input schemas and options increase choice entropy.

Resolution: Surface the simplest interface that can achieve the outcome.

“providing more choices to a model creates more opportunities for it to misfire, accidentally use wrong fields, or misunderstand parts of the prompt.”summary, stated
“what you actually want to surface to an agent is the simplest possible interface that achieves the desired outcome.”summary, stated

Raw tool payloads can degrade accuracy.

Root cause: Irrelevant fields bloat prompts and distract the model.

Resolution: Filter and reshape outputs before returning them to the agent.

“the prompt becomes bloated with irrelevant data, unnecessary tokens are processed, and accuracy demonstrably degrades.”summary, stated

Evaluation

The case reports qualitative production improvements rather than a benchmark; Databook evaluates tool masking by agent reliability, speed, cost, self-correction, and adaptability for enterprise customers.

Metrics: Yahoo Finance stock quote example returns approximately 100 fields. · Reported improvements in cleanliness, speed, reliability, cost, and self-correction.

“This approach resulted in cleaner, faster, more reliable agents with reduced costs, better self-correction capabilities”summary, stated
“A typical stock quote request returns approximately 100 different fields of data.”summary, stated

Outcomes

Databook applies this to enterprise sales automation for large technology companies such as Microsoft, Salesforce, and AWS.

“This approach resulted in cleaner, faster, more reliable agents with reduced costs, better self-correction capabilities, and the ability to rapidly adapt to customer requirements without code deployments.”summary, stated
“This approach resulted in cleaner, faster, more reliable agents with reduced costs, better self-correction capabilities, and the ability to rapidly adapt to customer requirements without code deployments.”summary, stated