Skip to main content
Welcome to this lab-style walkthrough. We’ll extend the previously deployed AWS MCP server by connecting declarative agents to it, then use those agents to query real-time AWS pricing. This guide shows how to:
  • Inspect MCP servers and agents in the KAgent UI
  • Deploy a declarative LLM-only agent and observe its behavior
  • Update the agent to attach AWS Pricing MCP server tools and compare results
  • Run simple and complex pricing queries through the agent
This content assumes you have the AWS Pricing MCP server and KAgent UI already running in your cluster.

Overview — What you’ll learn

  • How to register an agent that relies only on the LLM (no tools)
  • How to attach MCP server tools to the agent so it can call AWS Pricing APIs
  • How the agent invokes tools, receives structured pricing JSON, and produces human-friendly responses
  • Operational checks and debugging patterns for agents + MCP servers

Access the KAgent UI

  • Open the KAgent UI (top-right in your environment).
  • Skip the initial wizard if prompted and go to the main view.

Inspect running agents

  • In the KAgent UI, go to View → Agents to see registered agents.
  • At the start of this demo there are no agents registered.

Deploy an LLM-only agent (no tools)

A declarative agent manifest is provided at /root/no_tool_aws-price-checker.yaml. This agent is named aws-price-check and declares no tools, so it will rely entirely on the LLM (no live pricing calls). Example agent manifest (LLM-only)
Apply the agent manifest and check status
Representative status progression (condensed)
Agents without declared tools rely entirely on the LLM and cannot fetch live pricing. To obtain live pricing you must attach MCP server tools to the agent.
Try a pricing query (LLM-only)
  • Ask the LLM-only agent about the on-demand price for g4dn.16xlarge on Linux with shared tenancy in us-east-1 and ap-southeast-2.
  • Because the agent has no tool access, results will either be an LLM-derived estimate or a refusal like “Sorry, I do not have that pricing information available.”

Attach the AWS Pricing MCP server tools to the agent

Next, configure the agent to call the MCP server tools that expose the AWS Pricing List API. In the KAgent UI:
  • View → MCP servers → select the AWS Pricing MCP server (e.g. awslabs-aws-pricing-mcp-server-latest)
  • View → Tools to inspect available functions such as get_pricing, get_pricing_attribute_values, get_pricing_service_codes, generate_cost_report, etc.
Image: list and search of AWS pricing API tools in the KAgent UI
A webpage screenshot of the "kagent" site showing a search bar and a list of AWS pricing API tools (e.g., get_pricing, get_pricing_attribute_values) with short descriptions. The interface shows navigation links at the top and a count of "9 tools found."
Example tools block added to the agent manifest
Apply the edited manifest and confirm
Representative pod listing and agent YAML summary
Table: Common tool names exposed by the AWS Pricing MCP server

Run the same pricing query with tools attached

Re-run the earlier query for g4dn.16xlarge (Linux, shared tenancy) in us-east-1 and ap-southeast-2. With tools attached: How the call flow works
  1. The agent invokes an MCP server tool such as get_pricing with filters for region, operatingSystem, instanceType, and tenancy.
  2. The MCP server calls the AWS Pricing List API and returns structured JSON to the agent.
  3. The agent’s LLM processes the JSON and formats a human-readable response (tables, lists, or cost recommendations).
Tool response (excerpt)
Agent response (with tools)
  • Using the returned pricing data the agent can provide accurate results, for example:
    • us-east-1 on-demand price for Linux g4dn.16xlarge: approximately $4.35/hour
    • ap-southeast-2 on-demand price for Linux g4dn.16xlarge: approximately $5.65/hour
Image: chat UI showing pricing result for g4dn.16xlarge in us-east-1
Screenshot of a chat-style interface displaying AWS pricing results for a g4dn.16xlarge Linux instance in us‑east‑1 with an on‑demand price of about $4.35/hr. The right sidebar shows agent details and available pricing API functions.

Run more complex queries

You can request multi-dimensional comparisons in a single user prompt. The agent will orchestrate multiple tool calls (one per region/offer/purchase option), aggregate results, and return a consolidated table or list. Example complex query:
  • Compare on-demand and 1-year reserved pricing for an m7g instance across ap-southeast-2 (Sydney) and us-east-1 (N. Virginia). The agent will:
    • Call get_price_list_urls and get_pricing for each region and purchase option
    • Parse pricePerUnit from the returned JSON
    • Compute and present the comparisons in a table
Image: chat UI where the user requests a cross-region comparison for m7g instances
A screenshot of a chatbot UI where the user asks to compare on‑demand and 1‑year reserved pricing for AWS m7g EC2 instances across Sydney and N. Virginia. The right sidebar shows agent details and tool names, and the lower pane shows an "Executing tools..." area with Send/Cancel buttons.

Operational notes and best practices

Table: Troubleshooting checklist Additional patterns
  • Team workflow: Expose centralized pricing tools via an MCP server and create a pricing agent teams can call from CI/CD or chat to get cost estimates during planning or deployment.
  • Debugging: Review logs for the MCP server and agent pods (kubectl logs) to troubleshoot tool invocation failures.
  • Performance: Tool calls depend on MCP server latency, AWS Pricing API response time, and the number of distinct queries; batch or cache where appropriate.
Ensure the MCP server has the necessary AWS credentials and IAM permissions to call the AWS Pricing API. Without proper credentials, tool calls will fail even if the MCP server pod is Running.

References and further reading

That’s it for this lab-style lesson. Experiment with different tool combinations, regions, instance families, and purchase options to explore the full capabilities of agents + MCP servers.

Watch Video

Practice Lab