<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Noor Syed on Medium]]></title>
        <description><![CDATA[Stories by Noor Syed on Medium]]></description>
        <link>https://medium.com/@noorsyed_54501?source=rss-c373f967f515------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*4G8xf9Wf96358p-y.</url>
            <title>Stories by Noor Syed on Medium</title>
            <link>https://medium.com/@noorsyed_54501?source=rss-c373f967f515------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 03:10:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@noorsyed_54501/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[MCP Tool Responses in Claude Skills: Reasoning Quality, Cost, and Secure Credential Delivery]]></title>
            <link>https://medium.com/@noorsyed_54501/mcp-tool-responses-in-claude-skills-reasoning-quality-cost-and-secure-credential-delivery-200741e2830f?source=rss-c373f967f515------2</link>
            <guid isPermaLink="false">https://medium.com/p/200741e2830f</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[claude]]></category>
            <category><![CDATA[mcps]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Noor Syed]]></dc:creator>
            <pubDate>Sat, 16 May 2026 19:22:44 GMT</pubDate>
            <atom:updated>2026-05-16T19:22:44.557Z</atom:updated>
            <content:encoded><![CDATA[<p>When you build a Claude skill that calls an MCP tool, the response does not land in an isolated space. It goes straight into Claude’s context window — alongside every system prompt, user message, and skill instruction active in the session.</p><p>That matters for one core reason: it degrades reasoning quality while inflating cost and latency. And when you try to solve it, a second problem surfaces — credential delivery. This post covers both, and shows the architecture that addresses them.</p><h3>The Mechanism: How Tool Results Enter Context</h3><p>A skill is a set of instructions Claude reads and follows. When those instructions direct Claude to call an MCP tool, the tool executes and returns a tool_result block. That block is appended to the conversation history as a new message.</p><p>From that point forward, it sits in Claude’s working memory alongside everything else in the session. Claude sees all of it, for the remainder of the session.</p><h3>Problem 1: Raw Data Degrades Reasoning Quality</h3><p>The primary concern is reasoning quality. A 2023 Stanford/UW study — <a href="https://arxiv.org/abs/2307.03172">“Lost in the Middle: How Language Models Use Long Contexts”</a> (Liu et al.) — found that model performance degrades significantly when relevant information is positioned in the middle of long input contexts, with models performing best when key information appeared at the start or end. Frontier models have improved on this since, but the underlying principle holds: pre-synthesized summary tables and structured reductions give the model a cleaner signal to work with than raw, verbose payloads. Doing the aggregation and filtering programmatically, before data reaches context, is more reliable than asking the model to do it.</p><p>Latency and cost follow directly. Anthropic’s own documentation states that <a href="https://docs.anthropic.com/en/docs/test-and-evaluate/strengthen-guardrails/reduce-latency">“the fewer tokens the model has to process and generate, the faster the response will be”</a>. Every token in the context window is also charged on every subsequent inference call. A large tool result added early in a multi-turn session re-charges its full token cost on every turn that follows — in a typical skill workflow with five or six follow-up turns, you pay for that payload five or six times, and every response is slower for it.</p><p>Anthropic’s engineering blog describes this directly as “context pollution from intermediate results”: when Claude processes a large payload, the entire content enters the context window even though only a summary is needed. Their own Programmatic Tool Calling feature was built to address this — reporting a 37% reduction in token usage on complex research tasks by keeping intermediate results out of context.</p><p>The fix is to have the skill call the API via an inline script — Python or bash embedded in the skill instructions. The script handles the HTTP call, reduces the response, and returns only a summary to Claude’s context. Claude reasons over the reduction. It never sees the raw payload.</p><h3>Problem 2: The Credential Has to Get to the Script Somehow</h3><p>The inline script still needs a credential to authenticate against the API. How that credential is delivered determines whether the architecture holds.</p><p>Hardcoding it in the script is readable by anyone who can read the skill. Routing it through Claude’s context — asking Claude to retrieve or pass the token — means it transits the context window, where it sits alongside everything else for the rest of the session.</p><p>The correct approach is an exchange token issued by the MCP server:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mSmH7LArJSA8K7yOY1pjOQ.png" /><figcaption>Naive vs. out-of-band approach: in the naive flow the full API payload lands in Claude’s context window; in the out-of-band flow only the reduced result does.</figcaption></figure><ol><li>The skill instructs Claude to request a short-lived exchange token from the MCP server.</li><li>The MCP server issues a token scoped to a single API call, expiring in 60 seconds.</li><li>The inline script receives the token and uses it to call the external API directly.</li><li>The script reduces the response and returns only the result to Claude’s context.</li></ol><p>The long-lived credential never appears in context. The exchange token is single-use and short-lived — its exposure window is narrow and its value outside that window is zero.</p><p>The reduction step is not optional. If the script returns the raw API response, the reasoning quality and cost problems re-enter through a different path. The script’s job is to reduce, not to relay.</p><h3>Summary</h3><p>Raw API responses in Claude’s context window degrade reasoning quality, inflate cost, and slow inference. The fix is an inline script that calls the API directly, reduces the response, and returns only a clean summary to context.</p><p>The remaining design challenge is credential delivery. The exchange token pattern — a short-lived, single-use token issued by the MCP server — gets a credential to the script without routing a long-lived credential through Claude’s context. That is the specific problem it solves, and the reason the added complexity is worth it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=200741e2830f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>