Skip to main content
Glama
my_client.py1.49 kB
import asyncio from fastmcp import Client client = Client("http://localhost:8000/mcp") async def call_add_order(): async with client: result = await client.call_tool( "add_order", { "data": { "customer_name": "John Doe", "product_name": "MacBook Pro", "quantity": 2, "price_per_unit": 1999, "notes": "Urgent delivery" } } ) print("Add Order Result:", result) return result.get("order", {}).get("id") # return order id for testing async def call_search_orders(query: str): async with client: result = await client.call_tool( "search_orders", { "data": { "query": query } } ) print(f"Search Orders for '{query}':", result) async def call_get_order(order_id: str): async with client: result = await client.call_tool( "get_order", { "data": { "order_id": order_id } } ) print(f"Get Order {order_id}:", result) async def main(): # Add a new order order_id = await call_add_order() # Search for orders await call_search_orders("MacBook") # Get order by ID if order_id: await call_get_order(order_id) asyncio.run(main())

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/fedilahbib/MCP-server-using-FastMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server