Area: API Issues
Sub-Area: MCP Server / AI Integration
Issue
When using the DataHub MCP server with AI assistants (such as Claude), entity descriptions, field descriptions, and domain descriptions are truncated at a character limit before being returned to the AI. This behavior is intentional — it prevents long text from overflowing an LLM's context window when bulk entity data is returned — but the default limits have changed across versions and can cause AI assistants to return incomplete documentation, cut off code examples, or report that content was truncated. Users may see truncation at approximately 1,000 characters (older versions) or 5,000 characters (newer versions), depending on which release of the MCP server or local package is in use.
Error Messages
[Truncated by the tool at this point; the rest of the 5,000-character description wasn't returned.]- Description text silently cut off at approximately 1,000 characters in responses from
get_entities
You Might Be Asking
- Why is my entity or product description being cut off when I ask an AI assistant about it via the DataHub MCP?
- Is there a character limit on descriptions returned by the DataHub MCP server, and can it be changed?
- Does truncation apply only to entity descriptions, or also to field descriptions and domain descriptions?
- Can I configure the description length limit myself, or does it require a server-side change?
- What is the difference in truncation behavior between the hosted MCP server and the local
mcp-server-datahubpackage?
Solution
-
Understand the truncation limits by version.
The DataHub MCP server applies a hard character limit to all description fields (entity descriptions, field descriptions, domain descriptions) returned in tool responses. The limits have changed across releases:
-
OSS local package (
mcp-server-datahub) v1.0.x and earlier: Hard limit of 1,000 characters, hardcoded indatahub_agent_context/mcp_tools/helpers.py. - Hosted/Cloud MCP server and local package v1.1.0+: Default limit raised to 5,000 characters for general tool responses. The limit is now configurable via environment variable.
-
v2.3.1+ (when description is explicitly requested): When a description field is explicitly requested via the
fieldsparameter, the limit increases to 20,000 characters. If content still exceeds this limit, the response will indicate how much was omitted.
-
OSS local package (
-
Upgrade to the latest available version.
The most reliable fix is to ensure your deployment is running a supported release (v1.1.0 or later for the 5,000-character default; v2.3.1 or later for the 20,000-character explicit-request limit). Contact your DataHub administrator or support team to confirm your current version and request an upgrade if needed.
-
Request the description field explicitly (v2.3.1+).
If you are on v2.3.1 or later, you can retrieve significantly more description content by instructing your AI assistant to fetch the
descriptionfield explicitly rather than asking a general question about an entity. When thedescriptionfield is included in thefieldsparameter of an MCP tool call, the limit increases from 5,000 to 20,000 characters.Example prompt phrasing:
# Less effective (uses general entity lookup — 5,000 char limit applies): "Tell me about the product called X in DataHub." # More effective (explicit field request — 20,000 char limit applies): "Fetch the description field for the DataHub entity named X." -
Request a server-side environment variable override (hosted deployments).
For hosted or Cloud deployments, the description length limit is configurable via the
DESCRIPTION_LENGTH_LIMITenvironment variable set at the server level. Individual users cannot change this setting directly — it requires a configuration change applied by your DataHub administrator or the DataHub support team. If your descriptions consistently exceed the current default and upgrading is not immediately possible, contact support to request an increase for your deployment.# Example environment variable (set at the MCP server pod/process level by an administrator): DESCRIPTION_LENGTH_LIMIT=10000Note: Increasing this value raises token and context window consumption for every AI request that retrieves entity data. Coordinate with your administrator to choose an appropriate value.
-
Temporary local workaround for the OSS package (v1.0.x only, not recommended for production).
If you are running the
mcp-server-datahubpackage locally and cannot upgrade immediately, you can manually patch the hardcoded limit. This change will be overwritten on the nextpip install --upgradeand is not a permanent fix.- Find the installed package location:
pip show mcp-server-datahub - Open the following file in a text editor:
datahub_agent_context/mcp_tools/helpers.py - Change line 20 from:
to:DESCRIPTION_LENGTH_HARD_LIMIT = 1000DESCRIPTION_LENGTH_HARD_LIMIT = 5000 # or higher, e.g. 10000 for long code examples - Restart the local MCP server process for the change to take effect.
Warning: This patch applies only to the locally running package and will be lost on upgrade. Upgrading to v1.1.0 or later is the recommended permanent solution.
- Find the installed package location:
Additional Notes
Truncation applies uniformly to all description-type fields returned by the MCP server, including entity descriptions, field/column descriptions, and domain descriptions. The truncation limit is intentional design to prevent LLM context window overflow when many entities are returned in a single tool response — increasing the limit too aggressively can degrade AI assistant performance or cause token budget errors. The configurable DESCRIPTION_LENGTH_LIMIT environment variable is a server-side setting and cannot be adjusted by end users of a hosted deployment without administrator involvement. If you are on v2.3.1 or later and a description exceeds 20,000 characters, the MCP response will include a message indicating how many characters were omitted, rather than silently truncating.
Related Documentation
Tags: mcp, mcp-server, description-truncation, ai-integration, claude, llm, context-window, get-entities, field-descriptions, configuration