IBM i

IBM i 

A space for professionals working with IBM’s integrated OS for Power systems to exchange ideas, ask questions, and share expertise on topics like RPG and COBOL development, application modernization, open source integration, system administration, and business continuity.


#Power


#IBMi
#Power
#Operatingsystems
#Servers
 View Only

Tools, Resources and Prompts: The Three Building Blocks of an MCP Server on IBM i

By Jeff Cubinski posted 19 days ago

  

In my last article I showed how I run an MCP server natively in PASE, next to Db2 for i. This time I want to explain what the server actually gives the AI. MCP rests on three pillars: Tools, Resources and Prompts. Here's what each one is and how I use it on IBM i.

Tools: things the AI can run

A tool is something the AI can call to get an answer. On IBM i, I make each tool a Db2 stored procedure. The server describes the tool to the AI: what it does, when to use it, and what it needs. For example, I have tools to check stock levels for a part, find the vendors for an item, look up a customer's orders and list open orders.

The AI never writes its own SQL. It picks a tool, and the stored procedure runs on the IBM i under the shop's normal security. If you already have SQL and business logic on your system, this is a natural fit.

One lesson: the description matters. Claude chooses a tool by reading what it says, so a clear sentence about when to use it works better than just a name.

Resources: things the AI can read

Data tells you what happened. It doesn't tell you what to do about it. That's what Resources are for.

A resource is a document the AI can read. I wrote ten short policy documents in plain Markdown for my demo company: return and warranty policy, pricing and discount authority, credit hold, lead times, freight, and a few more. They sit in a folder on the IFS next to the server, and the server makes them available.

Here's where it paid off. In my demo I asked about a customer return. The AI pulled the order from Db2, then read the return policy and told the rep the order was past the 30-day window, that a restocking fee applied, and that an RMA was needed first. The order came from a tool. The rules came from a resource. Most shops keep this kind of knowledge in a binder, a shared drive or someone's head.

Prompts: ready-made starting points

A prompt is a saved set of instructions the user can pick. Instead of typing a long request, the rep taps one button.

So far I've built one: a pre-call briefing. A rep picks a customer, and the AI gathers order history, A/R and credit status, and stock, then puts it together as a briefing before the call. It can also research a prospect it hasn't seen before. I have more designed, like a daily open order report and a vendor comparison, but I haven't built them yet.

How the three pillars fit together

• Tools give the AI live facts from your IBM i.
• Resources give it your rules and procedures.
• Prompts give your people a one-tap way to ask for something that uses both.

None of this needs a new system. Stored procedures, Markdown files on the IFS and a Node.js server in PASE are all things an IBM i shop can already do.

What's next

I'm still building and testing, and I'll share what I learn. If your shop is thinking about AI and IBM i, I'd like to hear what you'd want it to do.

0 comments
13 views

Permalink