Back Home

GitHub Repo

Open WebUI Community Proposes MCP Deduplication Fix for Duplicate FastMCP List Results Sent to Models

An October 18 report from the Open WebUI community says the same data may enter model context twice when FastMCP tools return lists—as text and structured content. A fix was proposed that day but has not been merged; actual token and cost effects still need to be measured against workloads.

NASA · Public domain · Image source
zh-Hant

On October 18, the Open WebUI community reported an MCP compatibility issue: when a tool built with the standalone FastMCP package returns a list, the same result may be sent to the model twice. The reporter said they reproduced the issue in v0.12.3 and the dev image available at the time, and provided a minimal tool and the backend processing results. A contributor also proposed a fix that day. Issue report

The key is that the same data has two representations. The MCP specification allows tools to return JSON objects through structuredContent and recommends also providing serialized JSON in a text block for backward compatibility. Clients therefore need to recognize when both carry the same content to avoid duplication while preserving structured data that may not appear in the text. MCP Tools specification

The FastMCP tool in the report returns only two color strings. Its text block contains the full array, while the structured field wraps the same array in result. Open WebUI’s existing deduplication logic recognized the format where each list element occupies its own text block, so it missed the case where the entire array appears in a single block and appended the structured copy. The report also distinguishes the standalone FastMCP package from the official Python SDK, avoiding the assumption that similarly named packages behave the same way. Reproduction details

PR #32726 proposes ensuring that lists already present in text are sent only once, while continuing to pass along structured data not included in the text. The proposal says tool results may consume two to three times as many tokens, but that describes inflation for specific results and cannot be used to infer an equivalent increase in the full conversation or bill. As of this check, the PR remains open, with no record of a merge or deployment. Fix proposal

For agents that repeatedly retrieve search results, rows, or file lists, it is reasonable to infer that duplicated content increases context usage, making long-running tasks especially worth checking. Engineering teams can compare raw tool responses with the messages actually sent to the model, then monitor whether the fix makes it into a release and whether it preserves information unique to the summary and structured data. No independent performance measurements are currently available.

Sources

  1. MCP list results from FastMCP reach the model twice — Issue #32719
  2. Fix MCP list results from FastMCP servers reaching the model twice — PR #32726
  3. Model Context Protocol:Tools 與 Structured Content 規範