<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: mikerawsonnz</title>
    <description>The latest articles on DEV Community by mikerawsonnz (@mikerawsonnz).</description>
    <link>https://dev.to/mikerawsonnz</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3967610%2F55964374-73d7-4729-90f5-14e93410dc39.png</url>
      <title>DEV Community: mikerawsonnz</title>
      <link>https://dev.to/mikerawsonnz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mikerawsonnz"/>
    <language>en</language>
    <item>
      <title>Authenticated Multi-LLM Agent: Google-OAuth-gated Gemini</title>
      <dc:creator>mikerawsonnz</dc:creator>
      <pubDate>Mon, 15 Jun 2026 06:06:41 +0000</pubDate>
      <link>https://dev.to/mikerawsonnz/authenticated-multi-llm-agent-google-oauth-gated-gemini-kka</link>
      <guid>https://dev.to/mikerawsonnz/authenticated-multi-llm-agent-google-oauth-gated-gemini-kka</guid>
      <description>&lt;h2&gt;
  
  
  Securely Accessing LLMs with Authenticated Multi-LLM Agent
&lt;/h2&gt;

&lt;p&gt;In today's interconnected development landscape, integrating Large Language Models (LLMs) into applications is increasingly common. However, ensuring secure and controlled access to these powerful models, especially when dealing with sensitive user data or internal applications, presents a significant challenge. How do you verify who is making the request and then gate access to your LLM resources accordingly?&lt;/p&gt;

&lt;p&gt;This is where the &lt;strong&gt;Authenticated Multi-LLM Agent&lt;/strong&gt; comes in. This powerful agent provides a Google-OAuth-gated LLM gateway, allowing you to seamlessly verify a Google ID token and then run a Gemini (Vertex AI) completion for the authenticated caller. It's built upon a robust composition of &lt;code&gt;anthropic&lt;/code&gt;, &lt;code&gt;google-auth-oauthlib&lt;/code&gt;, &lt;code&gt;mcp&lt;/code&gt;, and &lt;code&gt;openai&lt;/code&gt;, offering a flexible and secure solution for your LLM access control needs.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Problem It Solves
&lt;/h3&gt;

&lt;p&gt;Imagine you're building an internal tool that leverages a powerful LLM for data analysis. You want to ensure that only authenticated employees can access this LLM and that their usage can be tracked. Manually implementing Google OAuth verification, managing API keys for different LLMs, and routing requests securely can be a complex and error-prone process.&lt;/p&gt;

&lt;p&gt;The Authenticated Multi-LLM Agent simplifies this by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Centralizing Authentication:&lt;/strong&gt; It handles the Google ID token verification process, ensuring that only legitimate users with valid Google accounts can proceed.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Gating LLM Access:&lt;/strong&gt; Once authenticated, it acts as a secure gateway, proxying requests to your chosen LLM (Gemini in this case) on behalf of the verified user.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Streamlining Integration:&lt;/strong&gt; It provides a unified interface, abstracting away the complexities of interacting directly with Google OAuth and the LLM provider.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Enabling Multi-LLM Strategies:&lt;/strong&gt; While this specific agent focuses on Gemini, its underlying composition allows for future expansion to other LLMs, providing a flexible foundation for your multi-LLM architecture.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How to Call It
&lt;/h3&gt;

&lt;p&gt;The Authenticated Multi-LLM Agent can be invoked over both streamable-http (for real-time interactions) and A2A (for asynchronous messaging). The MCP endpoint for this agent is: &lt;code&gt;https://anthropic-google-auth-oauthlib-mc-70ac16.getvda.ai/mcp&lt;/code&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  Calling over streamable-http
&lt;/h4&gt;

&lt;p&gt;To call the agent over streamable-http, you'll send a POST request to the MCP endpoint with a JSON body containing your Google ID token and the prompt for the Gemini LLM.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Request Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"google_id_token"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"YOUR_GOOGLE_ID_TOKEN_HERE"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"llm_prompt"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Explain the concept of quantum entanglement in simple terms."&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Response Example (successful completion):&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"success"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"llm_response"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Quantum entanglement is a phenomenon where two or more particles become linked in such a way that they share the same fate, no matter how far apart they are.  If you measure a property of one entangled particle, you instantly know the corresponding property of the other, even if it's light-years away. It's like having two coins that, no matter how much you flip them independently, always land on the same side – heads and heads, or tails and tails. This 'spooky action at a distance,' as Einstein called it, is a fundamental aspect of quantum mechanics."&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Calling over A2A (message/send)
&lt;/h4&gt;

&lt;p&gt;For asynchronous interactions, you can use the A2A &lt;code&gt;message/send&lt;/code&gt; method, providing the same JSON payload as the &lt;code&gt;data&lt;/code&gt; field.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Request Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"recipient"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://anthropic-google-auth-oauthlib-mc-70ac16.getvda.ai/mcp"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"data"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"google_id_token"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"YOUR_GOOGLE_ID_TOKEN_HERE"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"llm_prompt"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"What are the main applications of machine learning in healthcare?"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Response Example (successful completion):&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"success"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"llm_response"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Machine learning is revolutionizing healthcare in many ways, including: disease diagnosis and prediction, drug discovery and development, personalized treatment plans, medical image analysis, and robotic surgery assistance."&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Metered Execution
&lt;/h3&gt;

&lt;p&gt;While the discovery of agents (via &lt;code&gt;initialize/tools/list&lt;/code&gt;) is free, execution of the Authenticated Multi-LLM Agent is metered. This agent leverages Nevermined x402 micropayments for tracking and billing usage, ensuring a fair and transparent consumption model.&lt;/p&gt;

&lt;p&gt;Discover more powerful agents and unlock new possibilities for your applications.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://agents.getvda.ai/agents" rel="noopener noreferrer"&gt;https://agents.getvda.ai/agents&lt;/a&gt;&lt;/p&gt;

</description>
      <category>llm</category>
      <category>authentication</category>
      <category>gemini</category>
      <category>oauth</category>
    </item>
    <item>
      <title>Traced LLM Proxy: Gemini with OpenTelemetry &amp; Trace IDs</title>
      <dc:creator>mikerawsonnz</dc:creator>
      <pubDate>Mon, 08 Jun 2026 06:05:37 +0000</pubDate>
      <link>https://dev.to/mikerawsonnz/traced-llm-proxy-gemini-with-opentelemetry-trace-ids-425l</link>
      <guid>https://dev.to/mikerawsonnz/traced-llm-proxy-gemini-with-opentelemetry-trace-ids-425l</guid>
      <description>&lt;h2&gt;
  
  
  Tracing Your LLM Calls with the Agent Traced LLM Proxy
&lt;/h2&gt;

&lt;p&gt;In the world of AI-powered applications, understanding the inner workings of your LLM calls is crucial for debugging, performance optimization, and gaining insights. While LLMs offer incredible capabilities, their "black box" nature can make tracing difficult. This is where the Agent Traced LLM Proxy comes in – a powerful tool that wraps your Gemini (Vertex AI) completion requests in OpenTelemetry trace spans, providing invaluable visibility into your LLM interactions.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Problem It Solves
&lt;/h3&gt;

&lt;p&gt;Imagine your application makes numerous calls to Gemini for various tasks. When something goes wrong, or you want to understand latency, pinpointing the exact LLM interaction that caused the issue can be a nightmare. Traditional logging provides some clues, but it lacks the rich, contextual information that distributed tracing offers. The Agent Traced LLM Proxy solves this by automatically instrumenting your Gemini calls, giving you a detailed trace of each request, including its duration, and other relevant metadata. This means you can easily identify bottlenecks, troubleshoot errors, and gain a comprehensive view of your LLM's performance within your larger system.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to Call It Over MCP (Streamable-HTTP)
&lt;/h3&gt;

&lt;p&gt;The Traced LLM Proxy is easily accessible via the MCP (Message Control Protocol) using streamable-HTTP. This allows for a straightforward integration into your existing services.&lt;/p&gt;

&lt;p&gt;To make a completion request, you'll send a POST request to the MCP endpoint: &lt;code&gt;https://anthropic-mcp-opentelemetry-api-264025.getvda.ai/mcp&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Here's an example of a JSON request body:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"serviceId"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"anthropic-mcp-opentelemetry-api-264025.getvda.ai/mcp"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"method"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"call"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"params"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"model"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"gemini-pro"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"prompt"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Explain the concept of quantum entanglement in simple terms."&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The response will include the LLM's completion along with the OpenTelemetry trace and span IDs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"result"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"completion"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Quantum entanglement is a phenomenon where two or more particles become linked in such a way that they share the same fate..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"trace_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"span_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"q1r2s3t4u5v6w7x8"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  How to Call It Over A2A (Message/Send)
&lt;/h3&gt;

&lt;p&gt;For Agent-to-Agent (A2A) communication, you can use the &lt;code&gt;message/send&lt;/code&gt; endpoint. This is particularly useful in multi-agent architectures where agents need to interact with the Traced LLM Proxy.&lt;/p&gt;

&lt;p&gt;The A2A request structure will look similar:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"serviceId"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"anthropic-mcp-opentelemetry-api-264025.getvda.ai/mcp"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"method"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"message/send"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"params"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"payload"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"model"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"gemini-pro"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"prompt"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"What are the benefits of using a microservices architecture?"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The response will follow the same format as the MCP example, containing the &lt;code&gt;completion&lt;/code&gt;, &lt;code&gt;trace_id&lt;/code&gt;, and &lt;code&gt;span_id&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Discovery and Metering
&lt;/h3&gt;

&lt;p&gt;It's important to note that the discovery operations, such as &lt;code&gt;initialize&lt;/code&gt; and &lt;code&gt;tools/list&lt;/code&gt;, are completely free. This allows you to explore the agent's capabilities and understand its available methods without incurring any costs. However, the execution of LLM completion requests through the Traced LLM Proxy is metered. This metering is handled via Nevermined x402 micropayments, ensuring a transparent and fair pricing model based on your usage.&lt;/p&gt;

&lt;p&gt;By integrating the Agent Traced LLM Proxy into your development workflow, you gain unprecedented visibility into your LLM interactions, empowering you to build more robust, performant, and observable AI applications.&lt;/p&gt;

&lt;p&gt;Discover more agents and their capabilities at: &lt;a href="https://agents.getvda.ai/agents" rel="noopener noreferrer"&gt;https://agents.getvda.ai/agents&lt;/a&gt;&lt;/p&gt;

</description>
      <category>llm</category>
      <category>opentelemetry</category>
      <category>gemini</category>
      <category>proxy</category>
    </item>
    <item>
      <title>Structured Output: Gemini 2.5 Flash &amp; Instructor for Validated JSON</title>
      <dc:creator>mikerawsonnz</dc:creator>
      <pubDate>Mon, 08 Jun 2026 06:05:30 +0000</pubDate>
      <link>https://dev.to/mikerawsonnz/structured-output-gemini-25-flash-instructor-for-validated-json-2i7d</link>
      <guid>https://dev.to/mikerawsonnz/structured-output-gemini-25-flash-instructor-for-validated-json-2i7d</guid>
      <description>&lt;h2&gt;
  
  
  Generating Structured Data with Ease: Introducing the Structured Output MCP Agent
&lt;/h2&gt;

&lt;p&gt;Working with large language models often involves wrestling their free-form text output into a structured format for downstream processing. This "parsing tax" can be a significant bottleneck, requiring complex regex, error handling, and validation logic. What if you could simply tell the LLM the exact JSON schema you need, and it reliably delivered?&lt;/p&gt;

&lt;p&gt;Enter the &lt;strong&gt;Structured Output MCP Agent&lt;/strong&gt;. This powerful agent leverages the capabilities of &lt;code&gt;instructor&lt;/code&gt; over Google's Gemini 2.5 Flash on Vertex AI, combined with &lt;code&gt;fastmcp&lt;/code&gt;, to transform a natural language prompt and a JSON schema into validated, typed JSON output. It's designed to eliminate the parsing tax, making your LLM integrations cleaner, more robust, and significantly faster.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Problem It Solves
&lt;/h3&gt;

&lt;p&gt;Imagine you're building an application that extracts information from user queries – say, a booking system that needs to identify the destination, dates, and number of guests. Without structured output, you'd prompt the LLM, receive a text response, and then write custom code to parse that text, handle potential ambiguities, and validate the extracted data against your expected types (e.g., ensuring dates are actual dates, and guest counts are integers). This is brittle and time-consuming.&lt;/p&gt;

&lt;p&gt;The Structured Output MCP Agent solves this by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Guaranteed Schema Adherence:&lt;/strong&gt; It forces the LLM to conform its output to your specified JSON schema, dramatically reducing parsing errors.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Type Safety:&lt;/strong&gt; The output is not just valid JSON, but also adheres to the data types defined in your schema.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Reduced Development Time:&lt;/strong&gt; No more writing custom parsing and validation logic.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Increased Reliability:&lt;/strong&gt; Consistent, predictable output makes your applications more robust.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How to Call It
&lt;/h3&gt;

&lt;p&gt;You can interact with the Structured Output MCP Agent using either streamable-http for direct HTTP requests or A2A (Agent-to-Agent) messaging for more complex agent orchestrations.&lt;/p&gt;

&lt;p&gt;The agent's MCP endpoint is: &lt;code&gt;https://fastmcp-instructor-72225f.getvda.ai/mcp&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Using Streamable-HTTP
&lt;/h4&gt;

&lt;p&gt;For direct HTTP requests, you'll send a &lt;code&gt;POST&lt;/code&gt; request to the MCP endpoint with a JSON body.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example Request:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"method"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"structured_output"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"params"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"prompt"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Extract the user's name, their preferred contact method (email or phone), and the message they want to send."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"schema"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"object"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"properties"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"user_name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"string"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"The full name of the user"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"contact_method"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"string"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"enum"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"email"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"phone"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Preferred contact method"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"string"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"The message to send"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"required"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"user_name"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"contact_method"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"user_input"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"My name is Alice Wonderland, you can reach me at alice@example.com. I'd like to inquire about the new features."&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Example Response:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"result"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"user_name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Alice Wonderland"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"contact_method"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"email"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"I'd like to inquire about the new features."&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Using A2A (message/send)
&lt;/h4&gt;

&lt;p&gt;For agent-to-agent communication, you'd use the &lt;code&gt;message/send&lt;/code&gt; method, encapsulating the &lt;code&gt;structured_output&lt;/code&gt; call within the &lt;code&gt;payload&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example Request (A2A):&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"method"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"message/send"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"params"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"recipient_did"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"did:vda:fastmcp-instructor-72225f.getvda.ai"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"payload"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"method"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"structured_output"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"params"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"prompt"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Extract the user's name, their preferred contact method (email or phone), and the message they want to send."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"schema"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"object"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"properties"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"user_name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"string"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"The full name of the user"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"contact_method"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"string"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"enum"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"email"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"phone"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Preferred contact method"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"string"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"The message to send"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"required"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"user_name"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"contact_method"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"user_input"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"My name is Bob The Builder. Please call me at 555-1234 to discuss the project."&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Example Response (A2A - simplified, actual response includes A2A envelope):&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"result"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"user_name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Bob The Builder"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"contact_method"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"phone"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"to discuss the project."&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Discovery and Metering
&lt;/h3&gt;

&lt;p&gt;You can discover the capabilities of this agent (and others) by using the &lt;code&gt;initialize&lt;/code&gt; and &lt;code&gt;tools/list&lt;/code&gt; methods, which are free to call. Agent execution, including the &lt;code&gt;structured_output&lt;/code&gt; method, is metered via Nevermined x402 micropayments. This ensures fair usage and sustainable operation of the agent ecosystem.&lt;/p&gt;

&lt;p&gt;Start building more robust and intelligent applications today by integrating the Structured Output MCP Agent!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://agents.getvda.ai/agents" rel="noopener noreferrer"&gt;https://agents.getvda.ai/agents&lt;/a&gt;&lt;/p&gt;

</description>
      <category>gemini</category>
      <category>instructor</category>
      <category>json</category>
      <category>vertexai</category>
    </item>
    <item>
      <title>FastAPI Auth Token Service: Bcrypt Passwords &amp; JWT Sessions</title>
      <dc:creator>mikerawsonnz</dc:creator>
      <pubDate>Thu, 04 Jun 2026 15:43:42 +0000</pubDate>
      <link>https://dev.to/mikerawsonnz/fastapi-auth-token-service-4md</link>
      <guid>https://dev.to/mikerawsonnz/fastapi-auth-token-service-4md</guid>
      <description>&lt;h2&gt;
  
  
  Secure Authentication Simplified with FastAPI Auth Token Service
&lt;/h2&gt;

&lt;p&gt;Building secure authentication into your applications can be a complex and time-consuming endeavor. From securely hashing passwords to issuing and verifying session tokens, there are many potential pitfalls. Manually implementing these features often leads to security vulnerabilities and delays in product development.&lt;/p&gt;

&lt;p&gt;This is where the FastAPI Auth Token Service comes in. This powerful agent, built on &lt;code&gt;bcrypt&lt;/code&gt; for robust password hashing and &lt;code&gt;python-jose&lt;/code&gt; for JWT handling, provides a streamlined and secure solution for managing user authentication. It abstracts away the complexities, allowing you to integrate secure user sessions with minimal effort.&lt;/p&gt;

&lt;h3&gt;
  
  
  How it Solves the Problem
&lt;/h3&gt;

&lt;p&gt;The FastAPI Auth Token Service tackles two critical aspects of authentication:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Secure Password Hashing:&lt;/strong&gt; It uses &lt;code&gt;bcrypt&lt;/code&gt;, a cryptographically strong hashing function, to securely store user passwords. This prevents brute-force attacks and ensures that even if your database is compromised, user passwords remain protected.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;JWT Session Management:&lt;/strong&gt; It issues and verifies JSON Web Tokens (JWTs) for session management. JWTs are a secure and stateless way to transmit information between parties, allowing your application to authenticate users without storing session data on the server side. This improves scalability and reduces server load.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Calling the Agent over MCP (Streamable-HTTP)
&lt;/h3&gt;

&lt;p&gt;You can interact with the FastAPI Auth Token Service directly over its MCP endpoint using streamable-http. This is ideal for real-time authentication flows where your application needs to generate or validate tokens.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Endpoint:&lt;/strong&gt; &lt;code&gt;https://bcrypt-python-jose-d0e0d0.getvda.ai/mcp&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example: Hashing a Password&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To hash a password, send a POST request with the following JSON payload:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"service"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"hash_password"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"password"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"mySecurePassword123!"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The agent will respond with the hashed password:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"hashed_password"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"$2b$12$EXAMPLE_HASH_STRING_HERE"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Example: Issuing a JWT Token&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To issue a JWT token, provide the user's ID and any additional claims you want to include in the token:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"service"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"create_token"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"user_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"user123"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"claims"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"role"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"admin"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The agent will return a signed JWT:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"token"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoidXNlcjEyMyIsInJvbGUiOiJhZG1pbiIsImV4cCI6MTY3ODg4NjQwMH0.EXAMPLE_JWT_SIGNATURE"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Example: Verifying a JWT Token&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To verify a JWT token and retrieve its claims:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"service"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"verify_token"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"token"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoidXNlcjEyMyIsInJvbGUiOiJhZG1pbiIsImV4cCI6MTY3ODg4NjQwMH0.EXAMPLE_JWT_SIGNATURE"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The agent will respond with the token's payload if valid:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"claims"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"user_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"user123"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"role"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"admin"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"exp"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1678886400&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Calling the Agent over A2A (Message/Send)
&lt;/h3&gt;

&lt;p&gt;For asynchronous or background tasks, you can use A2A (Agent-to-Agent) communication via &lt;code&gt;message/send&lt;/code&gt;. This is particularly useful for scenarios where immediate responses aren't critical, such as processing user registrations in a queue. The JSON payload structure for &lt;code&gt;message/send&lt;/code&gt; will be identical to the MCP examples above, but the communication channel will differ.&lt;/p&gt;

&lt;h3&gt;
  
  
  Discovery and Metering
&lt;/h3&gt;

&lt;p&gt;While discovering the capabilities of this agent (via &lt;code&gt;initialize/tools/list&lt;/code&gt;) is free, execution of its services is metered. This agent leverages Nevermined x402 micropayments for execution. This ensures a fair and efficient ecosystem for agent services.&lt;/p&gt;

&lt;p&gt;By integrating the FastAPI Auth Token Service, you can significantly reduce development time and enhance the security posture of your applications. Focus on your core business logic while offloading complex authentication tasks to a reliable and secure agent.&lt;/p&gt;

&lt;p&gt;Discover more powerful agents at &lt;a href="https://getvda.ai/agents" rel="noopener noreferrer"&gt;https://getvda.ai/agents&lt;/a&gt;&lt;/p&gt;

</description>
      <category>fastapi</category>
      <category>jwt</category>
      <category>bcrypt</category>
      <category>authentication</category>
    </item>
  </channel>
</rss>
