<?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 Brundapanthula on Medium]]></title>
        <description><![CDATA[Stories by Brundapanthula on Medium]]></description>
        <link>https://medium.com/@brundapanthula?source=rss-11ccce968fd8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*tNncPFuLdu5ShQvY</url>
            <title>Stories by Brundapanthula on Medium</title>
            <link>https://medium.com/@brundapanthula?source=rss-11ccce968fd8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 03:10:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@brundapanthula/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[Build an AI Agent for IBM i using IBM Bob and MCP]]></title>
            <link>https://medium.com/@brundapanthula/build-an-ai-agent-for-ibm-i-using-ibm-bob-and-mcp-1e3f87d3eaa1?source=rss-11ccce968fd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/1e3f87d3eaa1</guid>
            <category><![CDATA[ibm-i]]></category>
            <category><![CDATA[watsonx-orchestrate]]></category>
            <category><![CDATA[artificalintelligence]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[ibm-bob]]></category>
            <dc:creator><![CDATA[Brundapanthula]]></dc:creator>
            <pubDate>Fri, 04 Dec 2026 10:47:53 GMT</pubDate>
            <atom:updated>2026-12-04T10:47:53.116Z</atom:updated>
            <content:encoded><![CDATA[<p>~ collaborators <a href="https://medium.com/u/11ccce968fd8">Brundapanthula</a> and <a href="https://medium.com/u/7cd3971f9723">Pooja Holkar</a></p><p>IBM i applications hold a significant amount of business data across industries. When building AI agents for these applications, one of the requirements we come across is accessing the existing Db2 for i data without making changes to the underlying RPG application.</p><p>One way of achieving this is by building APIs for the required database operations and integrating them with the AI agent. In this article, we explore a different approach using the IBM i MCP Server, IBM Bob and watsonx Orchestrate.</p><p>For our implementation, we have used SAMCO, a sample retail application on IBM i, which contains information about products, customers, inventory and orders.</p><p>The idea is to build an agent that lets users query this information in natural language.</p><h3>Component architecture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nd8sLyvRChcogdD6YXcufw.png" /><figcaption><em>Component architecture of IBM i integration with watsonx Orchestrate.</em></figcaption></figure><p>To understand the flow of our application, let’s look at the individual components involved.</p><ul><li>IBM Bob helps us understand the existing IBM i application, explore the database schema and generate the artifacts required for the integration.</li><li>IBM i MCP Server exposes the SQL queries as tools that can be consumed by the agent.</li><li>Mapepire provides connectivity between the MCP server and Db2 for i.</li><li>watsonx Orchestrate consumes the MCP tools to retrieve information based on the user query.</li></ul><p>For this implementation, both Mapepire and the MCP server run on the same IBM i system.</p><h3>Working with IBM i using Bob</h3><p>To work with IBM i from Bob, we need the IBM i Premium Package along with the Code for IBM i extension.</p><p>The premium package can be installed using the Install from VSIX option within Bob.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*F6UeVtN1raZ3ebQptf1DvQ.png" /><figcaption>IBMi ppi Installation</figcaption></figure><p>Once installed, we can see two additional modes in Bob — IBM i Developer and IBM i Database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*JAN3Sz9m21gGHARUlJP9eg.png" /><figcaption>IBMi Modes</figcaption></figure><p>Using the Code for IBM i extension, connect to the IBM i system and add the SAMCO library to the library list.</p><p>The SAMCO application consists of the following five tables:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vljfpT6pAu96u3C6EpE1XQ.png" /></figure><p>Now that Bob has access to the IBM i environment, we can use it to explore these tables and understand the relationships between them.</p><h3>Creating MCP tools using Bob</h3><p>How do we decide what database operations should be exposed to the agent?</p><p>For our application, we have identified a set of operations that a user would typically perform when looking for product or order information.</p><p>Instead of letting the agent generate SQL for every user query, we define the SQL statements beforehand and expose them as parameterized MCP tools.</p><p>Let’s consider a simple scenario where the user wants to retrieve all the products belonging to the electronics category.</p><p>We can ask Bob to understand the ARTICLE table and generate a SQL query that accepts a category ID as an input.</p><p>The following is the SQL query used in our implementation:</p><pre>SELECT<br>    A.ARID AS ARTICLE_ID,<br>    TRIM(A.ARDESC) AS PRODUCT_NAME,<br>    A.ARSALEPR AS SALE_PRICE,<br>    A.ARSTOCK AS STOCK_LEVEL<br>FROM SAMCO.ARTICLE A<br>WHERE A.ARTIFA = :category_id<br>  AND A.ARDEL &lt;&gt; &#39;X&#39;<br>ORDER BY A.ARDESC<br>FETCH FIRST 50 ROWS ONLY</pre><p>One thing to notice in the above query is the ARDEL column. The SAMCO application uses this column to identify deleted products. Hence, we need to exclude these records while retrieving the available products.</p><p>Similarly, while querying the order information, we need to handle ORDER as a reserved SQL keyword by enclosing the table name in double quotes.</p><p>Having the application and database context available to Bob helps us account for such conventions while generating the queries.</p><p>The next step is to convert these queries into MCP tool definitions.</p><p>Below is a snippet of the YAML configuration for the product category lookup tool:</p><pre>get_products_by_category:<br>  source: samco-db<br>  description: &gt;<br>    List all products belonging to a<br>    specific product category.<br>  parameters:<br>    - name: category_id<br>      type: string<br>      required: true<br>  security:<br>    readOnly: true<br>  statement: |<br>    SELECT<br>      A.ARID AS ARTICLE_ID,<br>      TRIM(A.ARDESC) AS PRODUCT_NAME,<br>      A.ARSALEPR AS SALE_PRICE,<br>      A.ARSTOCK AS STOCK_LEVEL<br>    FROM SAMCO.ARTICLE A<br>    WHERE A.ARTIFA = :category_id<br>      AND A.ARDEL &lt;&gt; &#39;X&#39;<br>    ORDER BY A.ARDESC<br>    FETCH FIRST 50 ROWS ONLY</pre><p>The description of the tool helps the agent understand when to invoke it, while the parameters define the inputs required to execute the query.</p><p>Following the same approach, we have defined eight MCP tools for the SAMCO application covering product search, category lookup, customer information and order history.</p><h3>Connecting Bob to the IBM i MCP Server</h3><p>The IBM i MCP Server is available as an npm package and can be installed within the PASE environment on IBM i.</p><pre>npm install @ibm/ibmi-mcp-server --save</pre><p>Once we have configured the Mapepire connection and the YAML file containing our tools, we can start the MCP server using HTTP transport.</p><p>To connect Bob to the running MCP server, we configure the MCP server details in the .bob/mcp.json file.</p><pre>{<br>  &quot;mcpServers&quot;: {<br>    &quot;ibmi-mcp-server&quot;: {<br>      &quot;type&quot;: &quot;streamable-http&quot;,<br>      &quot;url&quot;: &quot;http://&lt;ibmi-host&gt;:3011/mcp&quot;<br>    }<br>  }<br>}</pre><p>The above configuration is an example for a controlled development environment.</p><p>With the MCP connection established, we can use Bob to explore and validate the tools before registering them with watsonx Orchestrate.</p><p>This is useful because we can test the database operations independently instead of debugging the entire flow from the agent.</p><h3>Consuming the MCP tools in watsonx Orchestrate</h3><p>So far, we have identified the database operations, generated the SQL queries and exposed them as MCP tools.</p><p>The next step is to register these tools in watsonx Orchestrate using the Agent Development Kit (ADK) and associate them with an agent.</p><p>Let’s understand what happens when the user asks the agent:</p><p>“Show me all electronics products.”</p><p>The agent identifies the relevant tool, get_products_by_category, and passes ELE as the category ID.</p><p>The MCP server executes the corresponding SQL statement through Mapepire and retrieves the records from Db2 for i. The returned data is then used by the agent to respond to the user.</p><p>We can follow a similar flow to retrieve customer information or order details.</p><p><strong>Why use predefined tools?</strong></p><p>An alternative approach to solving the same problem is allowing the agent to generate SQL dynamically.</p><p>While that gives us the flexibility to handle a wider range of questions, for our retail application the operations are already known. Using predefined SQL tools allows us to validate the queries before making them available to the agent.</p><p>For example, the agent can retrieve the orders placed by a customer, but the actual query, tables being accessed and input parameters are defined by the developer.</p><p>For enterprise deployments, we would also need to consider authentication, database-level permissions, user-specific access to information and secure connectivity to the MCP server.</p><p>The scope of this implementation is limited to read-only operations.</p><p>What we wanted to explore through this implementation was the possibility of using Bob not just for application code generation, but also for building integrations around existing applications.</p><p>With IBM i continuing to serve as the system of record, we are able to introduce an AI agent for accessing the application data without modifying the existing RPG programs.</p><p>The same approach can be extended to other IBM i applications by identifying the relevant business operations and defining MCP tools for them.</p><h3>References</h3><p>IBM i MCP Server:<br><a href="https://github.com/IBM/ibmi-mcp-server">https://github.com/IBM/ibmi-mcp-server</a></p><p>SAMCO application:<br><a href="https://github.com/bmarolleau/IBM-i-Application-Modernization-with-Bob">https://github.com/bmarolleau/IBM-i-Application-Modernization-with-Bob</a></p><p>Code for IBM i:<br><a href="https://codefori.github.io/docs">https://codefori.github.io/docs</a></p><p><em>Based on collaborative technical work on IBM i, IBM Bob and watsonx Orchestrate.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e3f87d3eaa1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>