LLM Zoomcamp 2025

Agents Statistics

Distribution of scores and reported study time for this homework.

Submissions

181

Median total score

6

Average total score

7

Score distribution

All values are points.

Questions score

Min
6
Median
6.0
Max
6
Q1
6.0
Avg
6.0
Q3
6.0

Learning in public score

Min
-
Median
0.0
Max
7
Q1
0.0
Avg
0.7
Q3
0.0

Total score

Min
6
Median
6.0
Max
14
Q1
6.0
Avg
6.8
Q3
6.0

Time distribution

All values are hours reported by students.

Lectures

Min
1.0
Median
3.0
Max
128.0
Q1
2.0
Avg
5.2
Q3
4.0

Homework

Min
0.5
Median
3.0
Max
128.0
Q1
2.0
Avg
4.7
Q3
4.0

Question breakdown

Correctness and answer distribution per question.

1. Function description

181 / 181 correct (100.0%)

Answer Count
city 112
"city" 12
query 8
location 4
City 3
Search query to look up the weather for specific city 1
get_weather_tool = { "type": "function", "name": "get_weather", "description": "Get weather function", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "Provide city text to look up weather in that city" } }, "required": ["city"], "additionalProperties": False } } 1
get_weather_tool = { "type": "function", "name": "get_weather", # TODO1 "description": "Retrieves the current temperature for a given city. Returns a known value if the city is in the database, otherwise generates a random value.", # TODO2 "parameters": { "type": "object", "properties": { "city": { # TODO3 "type": "string", "description": "The name of the city to get the weather for." # TODO4 } }, "required": ["city"], # TODO5 "additionalProperties": False } } 1
TODO1: get_weather (a concise, unique function name) TODO2: Get the current weather for a specified city (a nice description) TODO3: city (a property/attribute relevant for the function) TODO4: The name of the city to get weather for (Property/Attribute description) TODO5: ["city"] (List of required params) 1
The value for TODO3 is: 'city' 1
Fetches the current weather conditions for a given location. 1
A function, in the llm landscape, refers to let the agent perform tasks like web searches or math 1
TODO3 = 'query' 1
What did you put in TODO3? city 1
Generate_Quote => Generate quotes of the author passed to the tool. Please return only the quotes 1
The name of the city(berlin) to get the temperature for 1
{ "type": "function", "function": { "name": "get_weather", "description": "Search the actual weather in a given city.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city to search the weather for." } }, "required": ["city"], "additionalProperties": False } } } 1
The name of the city to get the weather for. 1
"Get the current temperature for a given city." 1
Fetches the weather for a given city. 1
get_weather_tool = { "type": "function", "name": "get_weather", "description": "Returns the weather in degrees Celsius for the given city", "parameters": { "type": "object", "properties": {"city": {"type": "string", "description": "Name of the city to get the weather information for"}}, "required": ["city"], "additionalProperties": False, }, } 1
"string" 1
Get the current weather temperature for a given city 1
Tool defined with @mcp.tool that performs actions for the client. 1
# TODO1// name: get_weather # TODO2// description: Pulls the weather data # TODO3// city # TODO4// description: City name to look up weather data for # TODO5// Required: "city" 1
{'type': 'function', 'name': 'get_weather', 'description': 'Returns the current temperature in Celsius for the specified city.', 'parameters': {'type': 'object', 'properties': {'city': {'type': 'string', 'description': 'The name of the city to get the weather for.'}}, 'required': ['city'], 'additionalProperties': False}} 1
"Get the weather data (temperature in Celsius) for a given city" 1
retrieve weather data 1
get_weather_tool = { "type": "function", "name": "generate", "description": "Generate fake weather data", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "City name to look up in our database" } }, "required": ['city'], "additionalProperties": False } } 1
get_weather_tool = { "type": "function", "name": "get_weather", "description": "Get weather temperature for a specified city", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city to get weather for" } }, "required": ["city"], "additionalProperties": False } } 1
get_weather_tool = { "type": "function", "name": "get_weather", "description": "Returns the mock temperature for a given city. If the city is not known, it generates a random temperature.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city to get the weather for." } }, "required": ["city"], "additionalProperties": False } } 1
{ "type": "function", "name": "get_weather", "description": "Search city temperature in the weather database", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "Search city text to look up in the weather database." } }, "required": ["city"], "additionalProperties": False } } 1
TODO3 has the value "query" 1
TODO3: "city" 1
Get the current temperature for a given city. 1
get_weather_tool = { "type": "function", "name": "get_weather", "description": "Get the weather of the city", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "Search city for the weather" } }, "required": ["city"], "additionalProperties": False } } 1
Get the current temperature (degrees celsius) in a given city 1
get_weather_tool = { "type": "function", "name": "get_weather", "description": "get the current weather for a given city", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "search city name to get the current weather " } }, "required": ["city"], "additionalProperties": False } } 1
filled <TODO3> as City. The code describes What the function is called What it does What parameters it takes 1
TODO3 = "city" 1
get_weather_tool = { "type": "function", "name": "get_weather", "description": "Get the weather from a city", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "Search the weather data for a city" } }, "required": ["city"], "additionalProperties": False } } 1
get today's weather 1
{ "type": "function", "name": "weather-tool", "description": "This tool gets the weather at a specified location", "parameters": { "type": "object", "properties": { "query": { "type": "string", "description": "For a specific location, and unless otherwise stated, the current date and time, look up the weather" } }, "required": [ "query" ], "additionalProperties": false } } 1
"Gets the current weather from the selected city" 1
Retrieves the temperature for a specified city. 1
get_weather_tool = { "type": "function", "name": "get_weather", "description": "Retrieve the temperature for a specific city", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "Name of the city to get weather data for" } }, "required": ["city"], "additionalProperties": False } } 1
get_weather, "Retrieve the current weather given city as user input", city 1

2. Another tool description

181 / 181 correct (100.0%)

Answer Count
Sets the temperature for a specified city. 3
"Set the temperature for a given city in the weather database." 2
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Sets the temperature for a specified city or region", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city, e.g. New York" }, "temp": { "type": "number", "description": "The temperature to associate with the city, e.g. 20" } }, "required": ["city", "temp"], "additionalProperties": False } } 2
Add an weather entry to the database 1
Set the Weather of the City 1
{"type":"function","name":"set_weather","description":"Set the current weather for a given city in the weather database.","parameters":{"type":"object","properties":{"city":{"type":"string","description":"The name of the city to set the weather for."},"temp":{"type":"number","description":"The temperature to set for the city in Celsius."}},"required":["city","temp"],"additionalProperties":false}} 1
"Store the current temperature (in °C) for the specified city. If the city is already present, overwrite its value." 1
Save the weather for specific city in the database 1
The temperature value to set for the city 1
A function that sets the weather for a given city. 1
function that registers today's temperature for a particular city 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Sets the current weather for a specific city.", "parameters": { "type": "object", "properties": { "city": {"type": "string", "description": "The city, e.g., San Francisco"}, "temp": {"type": "number", "description": "The temperature value."}, }, "required": ["city", "temp"], "additionalProperties": False } } 1
Set the current temperature for a specific location 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Set the temperature as the weather for the input city", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The city to set its weather" }, "temp": { "type": "number", "description": "The temperature to set as the city's weather" } }, "required": ["city","temp"], "additionalProperties": False } } 1
"Update or add weather information for a given city in the database. 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Set the temperature of a given city in our record", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The city we want to set the temperature for" }, "temp": { "type": "string", "description": "The temperature we want to set for the city" } }, "required": ["city", "temp"], "additionalProperties": False } } 1
Set or update the weather temperature for a given city in the database Full tool: set_weather_tool = { "type": "function", "name": "set_weather", "description": "Set or update the weather temperature for a given city in the database", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city to set the weather for" }, "temp": { "type": "number", "description": "The temperature value in Celsius" } }, "required": ["city", "temp"], "additionalProperties": False } } 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Set the temperature for a given city in the weather database.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city where the temperature will be set." }, "temp": { "type": "number", "description": "The temperature value to set for the city (e.g., in Celsius)." } }, "required": ["city", "temp"], "additionalProperties": False } } 1
This function helps to set the weather for a given city name from in-memory dictionary, and a given temperature float number 1
set_weather_description = { "type": "function", "name": "get_weather", "description": "Get the current temperature for a given city.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "Name of the city to get the weather for." } }, "required": ["city"], "additionalProperties": False } } 1
Set or update the weather temperature for a specific city 1
Set the current weather for a given city. 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Set temperature for a city", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "cit to set the temperature of." }, "weather": { "type": "float", "description": " new temperature" } }, "required": ["city", "temp"], "additionalProperties": False } } 1
set_weather_tool = { "type": "function", "name": "set weather", "description": "Sets the temperature for a specified city.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city for which to set the weather data." }, "temp": { "type": "float", "description": "The temperature to associate with the city." } }, "required": ["city", "temp"], "additionalProperties": False } } 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Set weather temperature for a specified city", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city to set weather for" }, "temp": { "type": "number", "description": "The temperature value to set for the city" } }, "required": ["city", "temp"], "additionalProperties": False } } 1
Document the weather conditions for a particular city. 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Set Weather: Temperature in Centigrade for a city", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The city whose weather: temperature needs to be updated into known_weather_data " }, "temp": { "type": "number", "description": "The temperature that needs to be set into known_weather_data " } }, "required": ["city", "temp"], "additionalProperties": False } } 1
set city temperature for known city 1
Add weather data to our database 1
The temperature to set for the specified city 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "add weather data entry into known_weather_data", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "set the city name " }, "temp": { "type": "number", "description": "Set the temperature" } }, "required": ["city","temp"], "additionalProperties": False } } 1
Description for set_weather function: { "type": "function", "function": { "name": "set_weather", "description": "Set or update the temperature for a specified city in the database.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city, e.g. London" }, "temp": { "type": "number", "description": "The temperature to set for the city." } }, "required": [ "city", "temp" ] } } } 1
I wrote the above set_weather_tool schema with the description: "Set the temperature for a specified city or region." 1
{ "type": "function", "name": "set_weather", "description": "Add specific city temperature in the weather database", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "City text to be added to the weather data." }, "temp": { "type": "string", "description": "City temperature to be added to the weather data." } }, "required": ["city", "temp"], "additionalProperties": False } } 1
A function that adds or updates weather data for a city 1
Set the weather for a given city 1
Set the current temperature of a given city 1
Store or update the temperature of a specific city in the weather database 1
Sets or updates the temperature for a specific city in the weather database. 1
City or area to check the current temperature. 1
Link a city to its current temperature 1
A tool is a pre-defined function an agent can be invoked (ex.: search web, or querying from the database). Tools are registered with the agent and described in a spec 1
"Set the temperature for a specific city in the weather database." 1
Add the given temperature in the given city to the dictionary 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Sets the current temperature for a specified city.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city for which to set the temperature." }, "temp": { "type": "number", "description": "The temperature to set for the city, in Celsius." } }, "required": ["city", "temp"], "additionalProperties": False } } 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Sets the temperature for a specified city.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city, e.g. New York" }, "temp": { "type": "number", "description": "The temperature to associate with the city, e.g. 20" } }, "required": ["city", "temp"], "additionalProperties": False } } 1
city, temp 1
"Set or update the weather temperature for a given city in the database" (describes the function's purpose of modifying weather data) 1
Record the weather for a specific city 1
{ "type": "function", "name": "set_weather", "description": "Sets weather for a city", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "City you want to set the weather for" }, "temp": { "type": "number", "description": "Temperature for the city" } }, "required": ["city", "temp"], "additionalProperties": False } } 1
A function that can add weather data to our database 1
"Sets the weather temperature for a given city." 1
"description": "The name of the city to set the temperature for." 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Set the current weather for a specific city", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city to get the weather for" }, "temp": { "type": "number", "description": "The temperature in Celsius" } }, "required": ["city", "temp"], "additionalProperties": False } } 1
"description": "Set weather temperature for a specified city", 1
Search the Weather 1
Set the temperature for a specified city 1
Sets the current temperature for a specific city. 1
Add or update the current temperature in °C for a given city. 1
set_weather_tool = { "type": "function", "function": { "name": "set_weather", "description": "Add or update the temperature for a city in the weather database.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city to set the temperature for." }, "temp": { "type": "number", "description": "The temperature in Celsius to associate with the city." } }, "required": ["city", "temp"], "additionalProperties": False } } } 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Set weather temperature for a specified city, e.g. 70 degrees Farenheit in Paris, France.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city to set weather for, e.g. Paris, Francis" }, "temp": { "type": "number", "description": "The Farenheit or Celsius temperature value to set for the city, e.g. 70 degrees Farenheit" } }, "required": ["city", "temp"], "additionalProperties": False } } 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Set temperature (C) for a specified city.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "City to set the temperature (C) for." }, "temperature": { "type": "number", "description": "City temperature (C)." } }, "required": ["city", "temperature"], "additionalProperties": False } } 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Set the current weather information for a specified location", "parameters": { "type": "object", "properties": { "location": { "type": "string", "description": "The city and state/country (e.g., 'New York, NY' or 'London, UK')" } }, "required": ["location"], "additionalProperties": False } } 1
"Sets or updates the temperature (in Celsius) for a given city in the weather database." 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Adds weather data for a city", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "City name to set weather data for" } }, "required": ["city"], "additionalProperties": False } } 1
set_weather_tool = { "type": "function", "function": { "name": "set_weather", "description": "Set the current weather for a specific city", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city to set the weather for." }, "temp": { "type": "number", "description": "The temperature to set for the city." } }, "required": ["city", "temp"], "additionalProperties": False }, } } 1
{ "type": "function", "function": { "name": "set_weather", "description": "Sets or updates the temperature for a specified city in the database.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city, e.g., 'London'." }, "temp": { "type": "number", "description": "The temperature in Celsius to set for the city." } }, "required": [ "city", "temp" ] } } } 1
add_weather_data = { "type": "function", "name": "add_entry", "description": "Add weather data to the database", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city where we are looking for its climate" }, "temperature": { "type": "float", "description": "The temperatura of the given city", } }, "required": ["city", "temperature"], "additionalProperties": False } } 1
{ "type": "function", "name": "set_weather", "description": "Updates the temperature for the selected city", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city" }, "temp": { "type": "integer", "description": "The temperature to update" } }, "required": ["city", "temp"], "additionalProperties": False } } 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Set the weather temperature for a given city.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The city to set the weather for." }, "temp": { "type": "number", "description": "The temperature to set for the city." } }, "required": ["city", "temp"], "additionalProperties": False } } 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "a function to append temperature for a new city into the weather_data dictionary", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "the name of the city to add" }, "temp": { "type": "float", "description": "the temperature for the city" } }, "required": ["city", "temp"], "additionalProperties": False } } 1
set_weather_tool = { "type":"function", "name":"set_weather", "description":"Updates the temperature for cities in weather database or sets the temperature for new cities", "parameters":{ "type":"object", "properties":{"city": {"type":"string", "description":"name of the city"}, "temp": {"type":"float", "description":"temperature of the city"}}, "required":["city", "temp"], "additionalProperties": False } } 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Set the temperature for a specified city in the weather database.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city to update weather data for." }, "temp": { "type": "number", "description": "The temperature value to associate with the city." } }, "required": ["city", "temp"], "additionalProperties": False } } 1
Set the current weather for a specific city. 1
This function updates known_weather_data dictionary by adding new temperatures linked to cities. 1
Registers the weather for a given city by removing any whitespace and converting to lowercase. 1
set_weather_tool = { "name": "set_weather", "description": "Saves the weather of a city in degrees Celsius to the database ", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "Name of the city to save the weather information for", }, "temp": { "type": "number", "description": "The temperature value in degrees Celsius, of the city", }, }, "required": ["city", "temp"], }, } 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "set weather information", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "the name of the city the user is trying to get the weather" }, "temp":{ "type": "integer", "description": "set the city temperature in the database" } } }, "required": ["city", "temp"], "additionalProperties": False } 1
"Updates or adds the recorded temperature for a given city." 1
{ "type": "function", "function": { "name": "set_weather", "description": "Set the weather for a given city.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city to search the weather for." }, "temp": { "type": "string", "description": "The temperature to set for the city." } }, "required": ["city", "temp"], "additionalProperties": False } } } 1
{"type": "function", "name": "set_weather", "description": "Set the temperature for a given city.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city." }, "temp": { "type": "number", "description": "The temperature to set for the city." } }, "required": ["city", "temp"], "additionalProperties": False } } 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Add or update weather data for a city", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "City name to set the weather for", }, "temp": { "type": "float", "description": "Temperature in Celsius to set for the city", } }, "required": [ "city", "temp" ], "additionalProperties": False } } 1
update the temperature for a given city, use tools.add_tool(set_weather, set_weather_tool) 1
set weather data 1
{ "type": "function", "name": "set_weather", "description": "Set or update the weather temperature for a specific city in the database.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city for which to set the weather." }, "temp": { "type": "number", "description": "The temperature value to set for the city." } }, "required": ["city", "temp"], "additionalProperties": false } } 1
get_weather_tool = { "type": "function", "name": "set_weather", "description": "Set weather for location", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "City name" }, "temp": { "type": "float", "description": "Degrees" } }, "required": True, "additionalProperties": False } } 1
Add the current weather for a city 1
Add or update the weather temperature for a given city in the database 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "set weather for city", "parameters": { "type": "object", "properties": { "query": { "type": "string", "description": "add city and its weather to knowledge base" } }, "required": ["query"], "additionalProperties": False } } 1
{ "type": "function", "name": "set_weather", "description": "Set the current weather for a given city.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city to set the weather for." }, "temp": { "type": "number", "description": "The temperature to set for the city." } }, "required": ["city", "temp"], "additionalProperties": False } } 1
Resource defined with @mcp.resource that provides read data. 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Set the weather temperature for a given city", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city to update the weather for" }, "temp": { "type": "number", "description": "The temperature to set for the city, in Celsius" } }, "required": ["city", "temp"], "additionalProperties": False } } 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Set the temperature for a given city", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city to update weather for" }, "temp": { "type": "number", "description": "The temperature value to set for the city" } }, "required": ["city", "temp"], "additionalProperties": False } } 1
{ "type": "function", "function": { "name": "set_weather", "description": "Set or update the temperature for a specified city in the database.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city, e.g. London" }, "temp": { "type": "number", "description": "The temperature to set for the city." } }, "required": [ "city", "temp" ] } } } 1
{'type': 'function', 'name': 'get_weather', 'description': 'Returns the current temperature in Celsius for the specified city.', 'parameters': {'type': 'object', 'properties': {'city': {'type': 'string', 'description': 'The name of the city to get the weather for.'}}, 'required': ['city'], 'additionalProperties': False}} 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Set the weather of the city", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "City lookup the weather of" }, "temp": { "type": "float", "description": "Temperature of the city" } }, "required": ["city","temp"], "additionalProperties": False } } 1
"Set the temperature for the given city." 1
"description": "Adds weather data to our database", //"city": { "type": "string", "description": "City name to add weather data for" }, "temp": { "type": "string", "description": "Temperature to add to the database for that city" } 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Update or add the temperature (in Celsius) for a given city in the weather database.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city to set the weather for." }, "temp": { "type": "number", "description": "The temperature in Celsius to set for the city." } }, "required": ["city", "temp"], "additionalProperties": False } } 1
"Set the weather data (temperature in Celsius) for a given city" 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "set weather data", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city to retrieve weather data for", }, "temp": { "type": "number", "description": "The temperature to set for the city", } }, "required": ["city", "temp"], "additionalProperties": False } } 1
{ "type": "function", "name": "set_weather", "description": "The set_weather function allows you to set the current temperature for a given city.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "City name to set the current temperature for", }, "temp": { "type": "number", "description": "Temperature in Celsius to set for the city", } }, "required": ["city", "temp"], "additionalProperties": False } } 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Adds or updates the weather temperature for a specific city in the database.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city to set the weather for." }, "temp": { "type": "number", "description": "The temperature in Celsius to associate with the city." } }, "required": ["city", "temp"], "additionalProperties": False } } 1
set_weather_tool = { "type": "function", "name": "set", "description": "Add weather data to database", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "City name to save in our database" }, "temp": { "type": "float", "description": "City name to save in our database" } }, "required": ['city', 'temp'], "additionalProperties": False } } 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Set or update the current temperature for a given city.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city to update the weather for." }, "temp": { "type": "number", "description": "The temperature to set for the city (in degrees Celsius)." } }, "required": ["city", "temp"], "additionalProperties": False } } 1
set_weather_tool = { "name": "set_weather", "description": "Set or update the temperature for a specific city.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "Name of the city to set the temperature for." }, "temp": { "type": "number", "description": "Temperature in Celsius to set for the city." } }, "required": ["city", "temp"], } } 1
{ "type": "function", "name": "set_weather", "description": "Set or update the temperature for a specified city in the database.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city, e.g. London" }, "temp": { "type": "number", "description": "The temperature to set for the city." } }, "required": ["city", "temp"] } } 1
set_weather_tool = { "type": "function", "function": { "name": "set_weather", "description": "Add an entry to the temperature database", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city to add temperature", }, "temp": { "type": "number", "description": "The temperature value for the city to add", } }, "required": ["city", "temp"], "additionalProperties": False } } } 1
{ "type": "function", "name": "set_weather", "description": "Add current weather for provided city to database", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "name of the city" }, "temp": { "type": "float", "description": "weather value" } }, "required": ["city","temp"], "additionalProperties": False } } 1
set_weather_tool 1
set_weather_tool= { "type": "function", "name": "set_weather", "description": "Adds or updates the temperature for a given city in the weather database.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city to update" }, "temp": { "type": "number", "description": "The temperature to set for the city in Celsius" } }, "required": ["city", "temp"], "additionalProperties": False } } 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Set current temp for a given city", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The given city", }, "temp": { "type": "number", "description": "The current temp for a given city", } }, "required": ["city", "temp"], "additionalProperties": False } } 1
set_weather_description = { "type": "function", "name": "set_weather", "description": "Add an entry to the weather database", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The city to be added to the weather database", }, "temp": { "type": "number", "description": "The temperature in the city", } }, "required": ["city", "temp"], "additionalProperties": False } } 1
{ "type": "function", "name": "set_weather", "description": "Set the given weather temperature for a given city", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city to set weather for" }, "temp": { "type": "number", "description": "The temperature to set for the city" } }, "required": ["city", "temp"], "additionalProperties": False } } 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Set the weather temperature for a given city.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city to set the weather for." }, "temp": { "type": "number", "description": "The temperature to assign to the city." } }, "required": ["city", "temp"], "additionalProperties": False } } 1
{ "type": "function", "name": "set_weather", "description": "Set the temperature for a given city.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "Name of the city to set the weather for." }, "temp": { "type": "number", "description": "Temperature value to set for the city." } }, "required": ["city", "temp"], "additionalProperties": false } } 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Adds or updates the weather data for a given city.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city to store weather data for." }, "temp": { "type": "number", "description": "The temperature value to be stored for the city." } }, "required": ["city", "temp"], "additionalProperties": False } } 1
{ "type": "function", "name": "set_weather", "description": "Set weather data.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The city where the weather is set." }, "temp": { "type": "number", "description": "The temperature that defines the weather." }, }, "required": ["city", "temp"], "additionalProperties": False } } 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Set the weather data (temperature) for a specific city.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city to set the weather for." }, "temp": { "type": "number", "description": "The temperature value to set for the city." } }, "required": ["city", "temp"], "additionalProperties": False } } 1
Set the current temperature for a given city 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Update or set the current temperature for a specified city", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "Name of the city to update" }, "temp": { "type": "number", "description": "Temperature value (in °C) to set for the city" } }, "required": ["city", "temp"], "additionalProperties": False } } 1
Set the weather for a city 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Set the weather data for a city", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "City as a text field to set the weather." }, "temp": { "type": "number", "description": "Temperature as a float field to set the weather." } }, "required": ["city", "temp"], "additionalProperties": False } } 1
Set temperature for the provided city as a floating point number with one decimal place. Store temp as float, not as string. Update known_weather_data to store this information. 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Sets or updates the temperature for a given city.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city to set the weather for." }, "temp": { "type": "number", "description": "The temperature value to assign to the city, in degrees Celsius." } }, "required": ["city", "temp"], "additionalProperties": False } } 1
{ "type": "function", "name": "set_weather", "description": "Add weather data to our database for a city", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "City of the temperature to be added to our database." }, "temp": { "type": "number", "description": "Temperature in Celcius to be added to our database." } }, "required": ["city", "temp"], "additionalProperties": False } } 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Adds weather data to the database", "parameters": { "type": "object", "properties": { "query": { "type": "string", "description": "Gets the weather for a location" }, "weather_location": { "type": "string", "description": "Name of city", }, "temperature": { "type": "float", "description": "Temperature" } }, "required": ["query", "weather_location", "temperature"], "additionalProperties": False } } 1
"description": "Sets the temperature for a specified city." 1
Set or update the temperature for a given city in the weather database. 1
add new entry to weather DB 1
updates the weather temperature for a given city 1
Sets or updates the current weather data for a specified city in the database. 1
{'type': 'function', 'name': 'set_weather', 'description': 'Sets the temperature for a specified city.', 'parameters': {'type': 'object', 'properties': {'city': {'type': 'string', 'description': 'The name of the city for which to set the weather data.'}, 'temp': {'type': 'number', 'description': 'The temperature to associate with the city.'}}, 'required': ['city', 'temp'], 'additionalProperties': False}} 1
add_weather_to_data_tool = { "type": "function", "name": "set_weather", "description": "add new weather data to database", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The city to get the weather for, e.g., 'Berlin'" }, "weather": { "type": "float", "description": "Weather data point" } }, "required": ["city", "weather"], } } 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Add the weather of the city to database", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The city to be added to database" }, "temp": { "type": "number", "description": "The temperature to be added to database", } }, "required": ["city", "temp"], "additionalProperties": False } } 1
"Add or update weather data for a specified city in our database." 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Set the temperature for a specific city.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city to set the temperature for." }, "temp": { "type": "number", "description": "The temperature value to assign to the city." } }, "required": ["city", "temp"], "additionalProperties": False } } 1
Add or update the temperature (°C) for a given city in the weather database. 1
{'type': 'function', 'name': 'set_weather', 'description': 'Add city temperature to weather database', 'parameters': {'type': 'object', 'properties': {'city': {'type': 'string', 'description': 'The city for which we want to add the temperature'}, 'temp': {'type': 'number', 'description': 'The city temperature in Celsius degrees'}}, 'required': ['city', 'temp'], 'additionalProperties': False}} 1
Add an entry to the weather database 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Add weather in city in database", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "City name for which we want to add weather" }, "temp": { "type": "float", "description": "Temperature in the city" } }, "required": ["city", "temp"], "additionalProperties": False } } 1
""" Updates the weather temperature data for a specified city. Args: city (str): The name of the city to update. Will be normalized to lowercase and stripped of whitespace. temp (float): The temperature value to store for the city. Returns: str: Returns 'OK' upon successful update. Note: The city name is stored in lowercase with whitespace removed for consistency. Weather data is stored in the global 'known_weather_data' dictionary. """ 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "get and set the current weather for a given city", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "search city name to get the current weather " }, "temp": { "type": "string", "description": "set time of the city " } }, "required": ["city","temp"], "additionalProperties": False } } 1
{ "type": "function", "name": "set_weather", "description": "Set weather data by city name", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "city name" }, "temp": { "type": "number", "description": "temperature value" } }, "required": ["city", "temp"], "additionalProperties": False } } 1
This tool set's temperature for a city and stores it permanently 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Set the temperature for a given city in the weather database", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city to set weather data for" }, "temp": { "type": "number", "description": "The temperature in Celsius to set for the city" } }, "required": ["city", "temp"], "additionalProperties": False } } 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Adds new city and weather data into the database", "parameters": { "type" : "object", "properties": { "city": { "type": "string", "descrption": "city name to add in the database" }, "temp": { "type": "number", "description": "asscoaited temperature to the city to add in the database" } } } } 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Set the weather for a city", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "City to set the weather for" }, "temp": { "type": "number", "description": "The temperature to set" }, }, "required": ["city", "temp"], "additionalProperties": False } } 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Set the temperature for a specified city", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city to set weather for" }, "temp": { "type": "number", # float = "number" in JSON schema "description": "The temperature value to set" } }, "required": ["city", "temp"], "additionalProperties": False } } 1
{ "type": "function", "name": "set_weather", "description": "set weather for given city", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "city name" }, "temp": { "type": "float", "description": "temperature" } }, "required": ["city", "temp"], "additionalProperties": False } } 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Tool to set the current weather for a specified city.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city to set the weather for. It should be a valid city name.", }, "temp": { "type": "number", "description": "The temperature to set for the specified city. It should be a valid number.", } }, "required": ["city", "temp"], "additionalProperties": False } } 1
```python set_weather_tool = { "type": "function", "name": "set_weather", "description": "Set the temperature for a specified city in the weather database", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city to set weather for" }, "temp": { "type": "number", "description": "The temperature value to set for the city" } }, "required": ["city", "temp"], "additionalProperties": False } } ``` 1
set_weather_description = { "type": "function", "name": "set_weather", "description": "Set the weather for a city", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The city to set the weather for", }, "temp": { "type": "float", "description": "The temperature to set for the city", } }, "required": ["city", "temp"], "additionalProperties": False } } 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Set weather data for a specific city. This function allows you to store temperature information for a city in the weather database.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city for which to set the weather data. The city name will be normalized to lowercase and stripped of whitespace." }, "temp": { "type": "number", "description": "The temperature value to store for the city. This should be a numeric value (integer or float)." } }, "required": ["city", "temp"], "additionalProperties": False } } # Now we have both tools available tools = [search_tool, set_weather_tool] # Test the weather function print("Testing weather function:") result = set_weather("New York", 25.5) print(f"Result: {result}") print(f"Stored weather data: {known_weather_data}") 1
"description": "Sets the temperature", The tool descriptions like get_weather_tool and set_weather_tool because you're building an AI agent that can call external functions and it needs to know how to use them. 1
json\n{\n "type": "function",\n "name": "set_weather",\n "description": "Add or overwrite the temperature for a city.",\n "parameters": {\n "type": "object",\n "properties": {\n "city": {\"type\": \"string\", \"description\": \"City name.\"},\n \"temp\": {\"type\": \"number\", \"description\": \"Temperature in Celsius.\"}\n },\n \"required\": [\"city\", \"temp\"],\n \"additionalProperties\": false\n }\n} 1
"set the current weather for a given city in known weather data dictionary" 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Set the weather temperature for a city", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "City for setting the weather" }, "temp": { "type": "float", "description": "Temperature in celsius for a city" } }, "required": ["city", "temp"], "additionalProperties": False } } 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Set the temperature for the specified city", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "Name of the city for which the weather should be set" }, "temp": { "type": "number", "description": "Temperature value to set for the city" } }, "required": ["city", "temp"], "additionalProperties": False } } 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Set or update the temperature for a specific city. Use this when you need to store or update weather information for a city.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city to set weather for" }, "temp": { "type": "number", "description": "The temperature in Celsius to set for the city" } }, "required": ["city", "temp"], "additionalProperties": False } } 1
Input a city and weather to add the entry to known weather data 1
""" Stores or updates the temperature for a given city in the known_weather_data dictionary. Args: city (str): Name of the city (case-insensitive, leading/trailing spaces will be removed). temp (float): Temperature value (in degrees, assumed to be Celsius or Fahrenheit depending on context). Returns: str: Confirmation string "OK" indicating successful update. """ 1
"Add an entry to the weather database" 1
Set temperature for a specified city 1
""" Sets the temperature for a specified city. Parameters: city (str): The name of the city for which to set the weather data. temp (float): The temperature to associate with the city. """ 1
set_weather_tool = { "type": "function", "function": { "name": "set_weather", "description": "Add or update the temperature (°C) for a specified city in the weather database.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "Name of the city to add or update in the weather database" }, "temp": { "type": "number", "description": "Temperature in Celsius to set for the city" } }, "required": ["city", "temp"], "additionalProperties": False } } } 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Set the temperature for a specific city", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "Name of the city to set weather data for" }, "temp": { "type": "number", "description": "Temperature to associate with the city" } }, "required": ["city", "temp"], "additionalProperties": False } } 1
Saves the temperature of a specific city. 1
{'type': 'function', 'name': 'set_weather', 'description': 'set_weather info', 'parameters': {'type': 'object', 'properties': {'city': {'type': 'string', 'description': 'city name'}, 'temp': {'type': 'number', 'description': 'temperature in celcius'}}, 'required': ['city', 'temp'], 'additionalProperties': False}} 1
set_weather_tool = { "type": "function", "function": { "name": "set_weather", # ✅ Function name "description": "Add or update the weather temperature for a given city in the database.", # ✅ Human-friendly purpose "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "City name to update, e.g., Berlin" # ✅ City input }, "temp": { "type": "number", "description": "Temperature in Celsius to store for the city" # ✅ New temperature } }, "required": ["city", "temp"], # ✅ Both are required "additionalProperties": False } } } 1
Given a city and weather update it's current weather information 1
"Set or update the temperature for a given city in the weather database." 1
set_weather_tool = { "type": "function", "name": "set_weather", "description": "Updates the current weather temperature for a specific city.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city, for example, 'New York' or 'London'." }, "temp": { "type": "number", "description": "The temperature value to set, e.g., 20. The unit (Celsius, Fahrenheit) is determined by the tool's implementation." } }, "required": ["city", "temp"], "additionalProperties": False } } 1
set_weather_tool = { "type": "function", "function": { "name": "set_weather", "description": "Adds weather information for a given city into the database.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city for which the weather data is being added." }, "temp": { "type": "number", "description": "The temperature value (in °C) to store for the city." } }, "required": ["city", "temp"], "additionalProperties": False } } } 1
Generate_random_quote => Generate a popular quote from the internet. 1
set_weather_tool = { "type": "function", "name": "Weather recorder", "description": "tool which records weather", "parameters": { "type": "object", "properties": { "query": { "type": "string", "description": "city for which we need to predict the weather" }, "temp": { "type": "float", "description": "temperature which will be recorded into dictionary" } }, "required": ["query", "temp"], "additionalProperties": False } } 1
Sets the temperature for a given city. 1

3. FastMCP version

181 / 181 correct (100.0%)

Answer Count
2.10.5 98
2.10.6 28
2.11.3 10
2.10.4 10
Version: 2.10.5 3
2.12.2 3
2.11.1 3
2.9.2 2
2.11.2 2
fastmcp-2.10.5 2
'2.10.5' 2
2.0 2
Version: 2.10.6 1
fastmcp==2.10.5 1
2.12.0 1
Version: 2.11.3 1
1.94 1
Version installed: 2.10.5 1
version 2.0 1
1.11.0 1
0.4.1 1
2.10.2 1
2.7.1 1
1.9.4 1
2.11.0 1
2.10.3 1
'2.10.4' 1
fastmcp-2.11.2 1

4. MCP Server transport

181 / 181 correct (100.0%)

Answer Count
stdio 132
STDIO 13
'stdio' 12
http 3
http://localhost:3333 1
sse 1
stdio on command line, http when using Jupyter Notebook. 1
Transport: stdio 1
📦 Transport: STDIO 1
Starting MCP server 'Demo 🚀' with transport server.py:1371 'stdio' 1
STDIO (standard input/output) or Streamable HTTP (SSE or REST over HTTP) 1
Starting MCP server 'WeatherBot ' with transport 'stdio' 1
server.py:1371 1
<TODO> = stdio 1
Starting MCP server Weather MCP with transport stdio 1
STDIO, HTTP com streaming e SSE. 1
loopback 1
stdio (Had to run the script in weather_server.py from the terminal to get this working. See https://github.com/eadka/LLMcourseDT/blob/main/0a-agents/weather_server.py) 1
The output shows Starting MCP server 'Demo 🚀' with transport STDIO 1
Starting MCP server 'Weather Server 🌦' with server.py:1371 transport 'stdio' 1
Starting MCP server 'WeatherBot' with transport 'stdio' 1
So, for 'TODO' the answer is: 'stdio' 1
transport 'stdio' 1
Starting MCP server 'Demo 🚀' with transport 'stdio' 1

5. MCP communication

181 / 181 correct (100.0%)

Answer Count
{"jsonrpc":"2.0","id":3,"result":{"content":[{"type":"text","text":"20.0"}],"structuredContent":{"result":20.0},"isError":false}} 91
20.0 6
{"jsonrpc":"2.0","id":3,"result":20.0} 4
{ "jsonrpc": "2.0", "id": 3, "result": 20.0 } 3
20 3
{ "jsonrpc": "2.0", "id": 3, "result": { "content": [ { "type": "text", "text": "20.0" } ], "structuredContent": { "result": 20.0 }, "isError": false } } 3
"city": "Berlin" 2
{ "jsonrpc":"2.0", "id":3, "result":{ "content":[{"type":"text","text":"20.0"}], "structuredContent":{"result":20.0}, "isError":false } } 1
"params": {"name": "Berlin", "arguments": "20.0"} 1
{"result":20.0},"isError":false}} 1
{"jsonrpc":"2.0","id":4,"result":{"content":[{"type":"text","text":"20.0"}],"structuredContent":{"result":20.0},"isError":false}} 1
{"jsonrpc":"2.0","id":7,"result":{"content":[{"type":"text","text":"20.0"}],"structuredContent":{"result":20.0},"isError":false}} 1
"params": { "name": "get_weather", "arguments": { "city": "Berlin" } } 1
{'jsonrpc': '2.0', 'id': 3, 'error': {'code': -32602, 'message': 'Invalid request parameters', 'data': ''}} 1
{ "jsonrpc": "2.0", "id": 3, "result": { "city": "berlin", "temp": 25.2 } } 1
event: message data: {"jsonrpc":"2.0","id":3,"result":{"content":[{"type":"text","text":"20.0"}],"structuredContent":{"result":20.0},"isError":false}} 1
{ "jsonrpc": "2.0", "id": 3, "result": { "content": [ { "type": "text", "text": "17.6" } ], "structuredContent": { "result": 17.6 }, "isError": false } } 1
{"jsonrpc":"2.0","id":3,"result":{"content":[{"type":"text","text":"18.9"}],"structuredContent":{"result":18.9},"isError":false}} 1
{ "content": [{"type": "text", "text": "20.0"}], "structuredContent": {"result": 20.0}, "isError": false } 1
{'content': [{'type': 'text', 'text': '20.0'}], 'structuredContent': {'result': 20.0}, 'isError': False} 1
{"jsonrpc":"2.0","id":3,"result":{"content":[{"type":"text","text":"23.9"}],"structuredContent":{"result":23.9},"isError":false}} 1
{ "jsonrpc": "2.0", "id": 3, "result": 20.0 } 1
JSON-RPC over the chosen transport 1
{"jsonrpc":"2.0","id":3,"result":{"content":[{"type":"text","text":"Error calling tool 'get_weather': name 'known_weather_data' is not defined"}],"isError":true}, if we add after imports known_weather_data= {'b': 20.0} then it will return {"jsonrpc":"2.0","id":3,"result":{"content":[{"type":"text","text":"20.0"}],"structuredContent":{"result":20.0},"isError":false}} 1
{"jsonrpc":"2.0","id":3,"result":{"content":[{"type":"text","text":"24.3"}],"structuredContent":{"result":24.3},"isError":false}} 1
22.5 1
{"jsonrpc":"2.0","id":3,"result":{"content":[{"type":"text","text":"-2.7"}],"structuredContent":{"result":-2.7},"isError":false}} 1
"name": "get_weather" ; "arguments": {"city": "Berlin"} 1
CallToolResult(content=[TextContent(type='text', text='20.0', annotations=None, meta=None)], structured_content={'result': 20.0}, data=20.0, is_error=False) 1
{"jsonrpc":"2.0","id":3,"result":{"content":[{"type":"text","text":"2.2"}],"structuredContent":{"result":2.2},"isError":false}} 1
{"jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": {"name": "get_weather", "arguments": {"city": "berlin"}}} 1
{'protocolVersion': '2024-11-05', 'capabilities': {'experimental': {}, 'prompts': {'listChanged': False}, 'resources': {'subscribe': False, 'listChanged': False}, 'tools': {'listChanged': True}}, 'serverInfo': {'name': 'Demo 🚀', 'version': '1.11.0'}} 1
root@d34388fe1b15:/work/llm-rag-workshop/0a-agent-ws# python client.py >> {"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": "2024-11-05", "capabilities": {"roots": {"listChanged": true}, "sampling": {}}, "clientInfo": {"name": "test-client", "version": "1.0.0"}}} << {"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2024-11-05","capabilities":{"experimental":{},"prompts":{"listChanged":false},"resources":{"subscribe":false,"listChanged":false},"tools":{"listChanged":true}},"serverInfo":{"name":"Weather Tool ☀️","version":"1.11.0"}}} >> {"jsonrpc": "2.0", "method": "notifications/initialized"} 1
JSON-RPC over stdio 1
Client discovers and calls tools/resources; server executes and returns data. 1
{"jsonrpc":"2.0","id":3,"result":{"content":[{"type":"text","text":"20.0"}],"structured_content":{"result":20.0},"data":20.0}} 1
20.0°C. 1
{ "jsonrpc": "2.0", "id": 3, "result": 20.0 } 1
Initialization response: { "jsonrpc": "2.0", "id": 1, "result": { "protocolVersion": "2024-11-05", "capabilities": { "experimental": {}, "prompts": { "listChanged": false }, "resources": { "subscribe": false, "listChanged": false }, "tools": { "listChanged": true } }, "serverInfo": { "name": "Demo \ud83d\ude80", "version": "1.11.0" } } } Tools list response: { "jsonrpc": "2.0", "id": 2, "result": { "tools": [ { "name": "get_weather", "description": "Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.", "inputSchema": { "properties": { "city": { "title": "City", "type": "string" } }, "required": [ "city" ], "type": "object" }, "outputSchema": { "properties": { "result": { "title": "Result", "type": "number" } }, "required": [ "result" ], "title": "_WrappedResult", "type": "object", "x-fastmcp-wrap-result": true } }, { "name": "set_weather", "description": "Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", "inputSchema": { "properties": { "city": { "title": "City", "type": "string" }, "temp": { "title": "Temp", "type": "number" } }, "required": [ "city", "temp" ], "type": "object" }, "outputSchema": { "properties": { "result": { "title": "Result", "type": "string" } }, "required": [ "result" ], "title": "_WrappedResult", "type": "object", "x-fastmcp-wrap-result": true } } ] } } Call response: { "jsonrpc": "2.0", "id": 3, "result": { "content": [ { "type": "text", "text": "20.0" } ], "structuredContent": { "result": 20.0 }, "isError": false } } 1
{"jsonrpc":"2.0","id":2,"result":{"tools":[{"name":"get_weather","description":"Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.","inputSchema":{"properties":{"city":{"title":"City","type":"string"}},"required":["city"],"type":"object"},"outputSchema":{"properties":{"result":{"title":"Result","type":"number"}},"required":["result"],"title":"_WrappedResult","type":"object","x-fastmcp-wrap-result":true}},{"name":"set_weather","description":"Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.","inputSchema":{"properties":{"city":{"title":"City","type":"string"},"temp":{"title":"Temp","type":"number"}},"required":["city","temp"],"type":"object"}}]}} 1
{"jsonrpc":"2.0","id":3,"result":{"content":[{"type":"text","text":"24.9"}],"structuredContent":{"result":24.9},"isError":false}} 1
{"jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": {"name": "get_weather", "arguments": {"city": "Berlin"}}} {"jsonrpc":"2.0","id":3,"result":{"content":[{"type":"text","text":"-4.2"}],"structuredContent":{"result":-4.2},"isError":false}} 1
{"jsonrpc":"2.0","id":3,"result":{"content":[{"type":"text","text":"10.8"}],"structuredContent":{"result":10.8},"isError":false}} 1
{ "jsonrpc": "2.0", "id": 1, "result": { "content": [ { "type": "text", "text": "12" } ], "structuredContent": { "result": 12 }, "isError": false } } 1
initialize -> {'jsonrpc': '2.0', 'id': 1, 'result': {'protocolVersion': '2024-11-05', ...}} tools/list -> {'jsonrpc': '2.0', 'id': 2, 'result': {...}} get_weather -> {'jsonrpc': '2.0', 'id': 3, 'result': {'content': [{'type': 'text', 'text': '20.0'}]}} 1
put in {"jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": {"name": "get_weather","arguments":{"berlin"}}} but get nothing 1
{ "result": 20.0 } 1
{ "jsonrpc": "2.0", "id": 3, "result": { "result": 20.0 } } 1
{"jsonrpc":"2.0","id":3,"result":<temperature>} 1
{"jsonrpc":"2.0","id":3,"result":{"content":[{"type":"text","text":"33.6"}],"structuredContent":{"result":33.6},"isError":false}} 1
{'jsonrpc': '2.0', 'id': 3, 'method': 'tools/call', 'params': {'name': 'get_weather', 'arguments': {'city': 'berlin'}}} 1
the MCP protocol communication via stdin/stdout was successful. 1
{ "jsonrpc": "2.0", "id": 3, "result": { "temperature": "22°C", "unit": "Celsius", "city": "Berlin" } } 1
{"jsonrpc":"2.0","id":3,"result":{"content":[{"type":"text","text":"-2.0"}],"structuredContent":{"result":-2.0},"isError":false}} 1
import asyncio from fastmcp import Client import nest_asyncio # nest_asyncio allows the event loop to be nested, which is needed in environments like Jupyter # nest_asyncio.apply() async def main(): """ Connects to the weather_server and lists its available tools. """ # The client will run the weather_server.py script as a subprocess async with Client("weather_server.py") as mcp_client: tools = await mcp_client.list_tools() print(f"Available tools: {tools}") # In a Jupyter Notebook, you can run the async main function like this asyncio.run(main()) 1
There are different ways to communicate with an MCP server. Ours is currently running using standart input/output, which means that the client write something to stdin and read the answer using stdout. Let's ask the temperature in Berlin: {"jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": {"name": "<TODO>", "arguments": {<TODO>}}} What did you get in response? {"jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": {"name": "get_weather", "arguments": { "city": "Berlin" } } } Answer: {"jsonrpc":"2.0","id":3,"result":{"content":[{"type":"text","text":"20.0"}],"structuredContent":{"result":20.0},"isError":false}} 1
"name": "get_weather", "arguments": {"city":"Berlin"} 1
{ "jsonrpc": "2.0", "id": 1, "result": { "protocolVersion": "2024-11-05", "capabilities": { "experimental": {}, "prompts": {"listChanged": false}, "resources": {"subscribe": false, "listChanged": false}, "tools": {"listChanged": true} }, "serverInfo": { "name": "Weather", "version": "1.11.0" } } } 1
{"jsonrpc": "2.0", "id": 3, "result": 20.0 } 1
{ "jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": { "name": "get_weather", "arguments": {"city": "Berlin"} } } 1
{"jsonrpc":"2.0","id":3,"result":{"content":[{"type":"text","text":"20.0"}],"isError":false}} 1
CallToolResult(content=[TextContent(type='text', text='20.0', annotations=None, meta=None)], structured_content={'result': 20.0}, data=20.0, is_error=False 1
{"jsonrpc": "2.0", "id": 3, "result": {"content": [{"type": "text", "text": "20.0"}], "structuredContent": {"result": 20.0}, "isError": false}} 1
{"jsonrpc":"2.0","id":3,"result":18.7} 1
manually communicating with an MCP server using JSON-RPC over standard input/output. This helps you understand how a client initializes, lists tools, and calls functions like get_weather using structured requests 1
sonrpc': '2.0', 'id': 3, 'result': {'content': [{'type': 'text', 'text': '20.0'}], 'structuredContent': {'result': 20.0}, 'isError': False}} 1
{"jsonrpc":"2.0","id":3,"result":{"content":[{"type":"text","text":"21.5"}],"structuredContent":{"result":21.5},"isError":false}} 1
"params": {"name": "get_weather", "arguments": {"city": "Berlin"}} 1
eather in Berlin: {'content': [{'type': 'text', 'text': '-2.0'}], 'structuredContent': {'result': -2.0}, 'isError': False} 1
6.9 1
jsonrpc 2.0 1

6. MCP Client tools

181 / 181 correct (100.0%)

Answer Count
[Tool(name='get_weather', title=None, description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='set_weather', title=None, description="Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema=None, annotations=None, meta=None)] 30
[Tool(name='get_weather', title=None, description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta={'_fastmcp': {'tags': []}}), Tool(name='set_weather', title=None, description="Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema=None, annotations=None, meta={'_fastmcp': {'tags': []}})] 9
[Tool(name='get_weather', title=None, description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='set_weather', title=None, description="Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'string'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None)] 8
[Tool(name='get_weather', title=None, description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='set_weather', title=None, description="Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema=None, annotations=None, meta=None)] 6
Available tools: [Tool(name='get_weather', title=None, description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='set_weather', title=None, description="Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema=None, annotations=None, meta=None)] 6
CallToolResult(content=[TextContent(type='text', text='20.0', annotations=None, meta=None)], structured_content={'result': 20.0}, data=20.0, is_error=False) 4
[Tool(name='add', title=None, description='Add two numbers', inputSchema={'properties': {'a': {'title': 'A', 'type': 'integer'}, 'b': {'title': 'B', 'type': 'integer'}}, 'required': ['a', 'b'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'integer'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='get_weather', title=None, description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='set_weather', title=None, description="Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema=None, annotations=None, meta=None)] 4
[Tool(name='get_weather', description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, annotations=None), Tool(name='set_weather', description="Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, annotations=None)] 2
get_weather: Retrieves the temperature for a specified city. set_weather: Sets the temperature for a specified city. 2
name='get_weather' title=None description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.' inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'} outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True} annotations=None meta=None name='set_weather' title=None description="Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update." inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'} outputSchema=None annotations=None meta=None 2
[Tool(name='add', title=None, description='Add two numbers', inputSchema={'properties': {'a': {'title': 'A', 'type': 'integer'}, 'b': {'title': 'B', 'type': 'integer'}}, 'required': ['a', 'b'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'integer'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='get_weather', title=None, description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='set_weather', title=None, description="Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'string'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None)] 2
[Tool(name='add', title=None, description='Add two numbers', inputSchema={'properties': {'a': {'title': 'A', 'type': 'integer'}, 'b': {'title': 'B', 'type': 'integer'}}, 'required': ['a', 'b'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'integer'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta={'_fastmcp': {'tags': []}}), Tool(name='get_weather', title=None, description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta={'_fastmcp': {'tags': []}}), Tool(name='set_weather', title=None, description="Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema=None, annotations=None, meta={'_fastmcp': {'tags': []}})] 2
Available tools: [Tool(name='get_weather', title=None, description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta={'_fastmcp': {'tags': []}}), Tool(name='set_weather', title=None, description="Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema=None, annotations=None, meta={'_fastmcp': {'tags': []}})] 2
Available tools: [Tool(name='add', title=None, description='Add two numbers', inputSchema={'properties': {'a': {'title': 'A', 'type': 'integer'}, 'b': {'title': 'B', 'type': 'integer'}}, 'required': ['a', 'b'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'integer'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='get_weather', title=None, description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='set_weather', title=None, description="Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema=None, annotations=None, meta=None)] 2
[Tool(name='get_weather', title=None, description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None)] 2
['get_weather', 'set_weather'] 2
Available tools: [Tool(name='get_weather', title=None, description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None)] 2
[ { "name": "get_weather", "description": "Get the weather for a given city", "parameters": { "type": "object", "properties": { "city": { "type": "string" } }, "required": ["city"] } } ] 1
Tool: add Tool: get_weather Tool: set_weather 1
FastMCP client, VS Code Continue extension, Claude Desktop 1
name='get_weather' title=None description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city. ' inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'} outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True} annotations=None meta=None name='set_weather' title=None description="Sets the temperature for a specified city.\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update." inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'} outputSchema=None annotations=None meta=None 1
{'name': 'get_weather', 'description': 'Retrieves the temperature for a specified city.\nParameters:\n city (str): The name of the city for which to retrieve weather data.\nReturns:\n float: The temperature associated with the city.', 'inputSchema': {'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, 'outputSchema': {'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, '_meta': {'_fastmcp': {'tags': []}}} {'name': 'set_weather', 'description': "Sets the temperature for a specified city.\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\nReturns:\n str: A confirmation string 'OK' indicating successful update.", 'inputSchema': {'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, 'outputSchema': {'properties': {'result': {'title': 'Result', 'type': 'string'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, '_meta': {'_fastmcp': {'tags': []}}} 1
Available tools: name='get_weather' title=None description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.' inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'} outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True} annotations=None meta=None name='set_weather' title=None description="Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update." inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'} outputSchema={'properties': {'result': {'title': 'Result', 'type': 'string'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True} annotations=None meta=None 1
[Tool(name='get_weather', title=None, description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta={'_fastmcp': {'tags': []}}), Tool(name='set_weather', title=None, description="Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: 'OK' on success.", inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'string'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta={'_fastmcp': {'tags': []}})] 1
- Name: get_weather Description: Get current weather information for a specified location Parameters: {'properties': {'location': {'title': 'Location', 'type': 'string'}}, 'required': ['location'], 'type': 'object'} - Name: add Description: Add two numbers Parameters: {'properties': {'a': {'title': 'A', 'type': 'integer'}, 'b': {'title': 'B', 'type': 'integer'}}, 'required': ['a', 'b'], 'type': 'object'} 1
Available tools: [Tool(name='get_weather', title=None, description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='set_weather', title=None, description="Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema=None, annotations=None, meta=None)] 1
[ { "name": "get_weather", "description": "Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.", "parameters": { "type": "object", "properties": { "city": { "type": "string" } }, "required": [ "city" ] } }, { "name": "set_weather", "description": "Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", "parameters": { "type": "object", "properties": { "city": { "type": "string" }, "temp": { "type": "number" } }, "required": [ "city", "temp" ] } } ] 1
[Tool(name='get_weather', title=None, description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='set_weather', title=None, description="Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'string'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None) 1
get_weather: Retrieves the temperature for a specified city. Parameters: city (str): The name of the city for which to retrieve weather data. Returns: float: The temperature associated with the city. set_weather: Sets the temperature for a specified city. Parameters: city (str): The name of the city for which to set the weather data. temp (float): The temperature to associate with the city. Returns: str: A confirmation string 'OK' indicating successful update. 1
{ "name": "get_weather", "description": "Retrieve the temperature for a specified city.", "inputSchema": { "properties": { "city": { "title": "City", "type": "string" } }, "required": ["city"], "type": "object" }, "outputSchema": { "properties": { "result": { "title": "Result", "type": "number" } }, "required": ["result"], "title": "_WrappedResult", "type": "object", "x-fastmcp-wrap-result": true } } { "name": "set_weather", "description": "Set the temperature for a specified city.", "inputSchema": { "properties": { "city": { "title": "City", "type": "string" }, "temp": { "title": "Temp", "type": "number" } }, "required": ["city", "temp"], "type": "object" }, "outputSchema": { "properties": { "result": { "title": "Result", "type": "string" } }, "required": ["result"], "title": "_WrappedResult", "type": "object", "x-fastmcp-wrap-result": true } } 1
[Tool(name='get_weather', title=None, description='Retrieve the temperature for a specified city.\n\nParameters\n----------\ncity : str\n The name of the city.\n\nReturns\n-------\nfloat\n The temperature for that city. If the city has been\n previously stored, the stored temperature is returned;\n otherwise a random value between –5 °C and 35 °C is generated.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='set_weather', title=None, description='Store a temperature for a specified city.\n\nParameters\n----------\ncity : str\n The city name.\ntemp : float\n Temperature in °C.\n\nReturns\n-------\nstr\n The confirmation string ``"OK"`` when the operation succeeds.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'string'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None)] 1
name='add' title=None description='Add two numbers' inputSchema={'properties': {'a': {'title': 'A', 'type': 'integer'}, 'b': {'title': 'B', 'type': 'integer'}}, 'required': ['a', 'b'], 'type': 'object'} outputSchema={'properties': {'result': {'title': 'Result', 'type': 'integer'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True} annotations=None meta=None name='get_weather' title=None description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.' inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'} outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True} annotations=None meta=None name='set_weather' title=None description="Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update." inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'} outputSchema=None annotations=None meta=None 1
Available tools: [Tool(name='get_weather', title=None, description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='set_weather', title=None, description="Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'string'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None)] Weather result: CallToolResult(content=[TextContent(type='text', text='20.0', annotations=None, meta=None)], structured_content={'result': 20.0}, data=20.0, is_error=False) 1
tools = [Tool(name='get_weather', title=None, description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='set_weather', title=None, description="Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema=None, annotations=None, meta=None)] 1
List of available tools [Tool(name='get_weather', title=None, description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='set_weather', title=None, description="Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema=None, annotations=None, meta=None)] 1
{ "jsonrpc": "2.0", "id": 2, "result": { "tools": [ { "name": "get_weather", "inputSchema": { "properties": { "city": { "title": "City", "type": "string" } }, "required": [ "city" ], "type": "object" }, "outputSchema": { "properties": { "result": { "title": "Result", "type": "number" } }, "required": [ "result" ], "title": "_WrappedResult", "type": "object", "x-fastmcp-wrap-result": true } }, { "name": "set_weather", "inputSchema": { "properties": { "city": { "title": "City", "type": "string" }, "temp": { "title": "Temp", "type": "number" } }, "required": [ "city", "temp" ], "type": "object" }, "outputSchema": { "properties": { "result": { "title": "Result", "type": "string" } }, "required": [ "result" ], "title": "_WrappedResult", "type": "object", "x-fastmcp-wrap-result": true } } ] } } 1
[ { "name": "get_weather", "title": null, "description": "Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.", "inputSchema": { "properties": { "city": { "title": "City", "type": "string" } }, "required": [ "city" ], "type": "object" }, "outputSchema": { "properties": { "result": { "title": "Result", "type": "number" } }, "required": [ "result" ], "title": "_WrappedResult", "type": "object", "x-fastmcp-wrap-result": true }, "annotations": null, "meta": { "_fastmcp": { "tags": [] } } }, { "name": "set_weather", "title": null, "description": "Sets or updates the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", "inputSchema": { "properties": { "city": { "title": "City", "type": "string" }, "temp": { "title": "Temp", "type": "number" } }, "required": [ "city", "temp" ], "type": "object" }, "outputSchema": null, "annotations": null, "meta": { "_fastmcp": { "tags": [] } } } ] 1
list_tools(), list_resources(), call_tool(), read_resource(), get_prompt(). 1
http://127.0.0.1:8000 1
[Tool(name='get_weather', title=None, description='Get weather for location\n\nParameters:\n city (str): Name of the city to get weather for\n\nReturns:\n float: Teamperature in city', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='set_weather', title=None, description="Set weather for location\n\nParameters:\n city (str): Name of the city to set weather for\n temp (float): The temperature to associate with the city.\nReturns:\n str: A confirmation string 'OK' indicating successful update.", inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema=None, annotations=None, meta=None)] 1
[{'name': 'get_weather', 'description': 'Retrieves the temperature for a specified city.', 'parameters': {'type': 'object', 'properties': {'city': {'type': 'string', 'description': 'The name of the city for which to retrieve weather data.'}}, 'required': ['city']}}, {'name': 'set_weather', 'description': 'Sets the temperature for a specified city.', 'parameters': {'type': 'object', 'properties': {'city': {'type': 'string', 'description': 'The name of the city for which to set the weather data.'}, 'temp': {'type': 'number', 'description': 'The temperature to associate with the city.'}}, 'required': ['city', 'temp']}}] 1
get_weather - Retrieves the temperature for a specified city. Parameters: city (str): The name of the city for which to retrieve weather data. Returns: float: The temperature associated with the city. set_weather - Sets the temperature for a specified city. Parameters: city (str): The name of the city for which to set the weather data. temp (float): The temperature to associate with the city. Returns: str: A confirmation string 'OK' indicating successful update. 1
Starting MCP server 'Demo 🚀' with transport 'stdio' server.py:1371 [Tool(name='get_weather', title=None, description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='set_weather', title=None, description="Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'string'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None)] 1
Available tools: [Tool(name='get_weather', title=None, description='Get the current weather for a given city or location.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='set_weather', title=None, description='this function sets or updates the temperature for a city or location.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema=None, annotations=None, meta=None)] 1
get_weather; set_weather. 1
[Tool(name='get_weather', title=None, description=None, inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='set_weather', title=None, description=None, inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'string'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None)] 1
{ "tools": [ { "name": "get_weather", "description": "Retrieves the temperature for a specified city.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city for which to retrieve weather data." } }, "required": ["city"], "additionalProperties": false } }, { "name": "set_weather", "description": "Sets the temperature for a specified city.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city for which to set the weather data." }, "temp": { "type": "number", "description": "The temperature to associate with the city." } }, "required": ["city", "temp"], "additionalProperties": false } } ] } 1
async def main(): async with Client(weather_server.mcp) as mcp_client: tools = await mcp_client.list_tools() print("✅ Available tools:") import json # Convert each tool object to a dictionary tools_dicts = [tool.model_dump() for tool in tools] print(json.dumps(tools_dicts, indent=2, sort_keys=False)) # pprint(tools_dicts, indent=2, sort_dicts=False) await main() 1
- get_weather: Retrieves the temperature for a specified city. Parameters: city (str): The name of the city for which to retrieve weather data. Returns: float: The temperature associated with the city. - set_weather: Sets the temperature for a specified city. Parameters: city (str): The name of the city for which to set the weather data. temp (float): The temperature to associate with the city. Returns: str: A confirmation string 'OK' indicating successful update. 1
Tool(name='add', title=None, description='Add two numbers', inputSchema={'properties': {'a': {'title': 'A', 'type': 'integer'}, 'b': {'title': 'B', 'type': 'integer'}}, 'required': ['a', 'b'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'integer'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='get_weather', title=None, description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='set_weather', title=None, description="Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema=None, annotations=None, meta=None)] 1
Available Tools: -------------------------------------------------- Name: get_weather Description: Retrieves the temperature for a specified city. Parameters: city (str): The name of the city for which to retrieve weather data. Returns: float: The temperature associated with the city. Parameters: - city (string): No description -------------------------------------------------- Name: set_weather Description: Sets the temperature for a specified city. Parameters: city (str): The name of the city for which to set the weather data. temp (float): The temperature to associate with the city. Returns: str: A confirmation string 'OK' indicating successful update. Parameters: - city (string): No description - temp (number): No description -------------------------------------------------- 1
Tool(name='get_weather', title=None, description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='set_weather', title=None, description="Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema=None, annotations=None, meta=None)] 1
[ {"name": "get_weather", "description": "Retrieves temperature for a city"}, {"name": "set_weather", "description": "Sets temperature for a city"} ] 1
[ { "name": "get_weather", "description": "Get weather temperature for a specified city", "inputSchema": { "type": "object", "properties": { "city": { "type": "string", "title": "City" } }, "required": ["city"] }, "outputSchema": { "type": "object", "properties": { "result": { "type": "number", "title": "Result" } }, "required": ["result"], "x-fastmcp-wrap-result": true } }, { "name": "set_weather", "description": "Set weather temperature for a specified city", "inputSchema": { "type": "object", "properties": { "city": { "type": "string", "title": "City" }, "temp": { "type": "number", "title": "Temp" } }, "required": ["city", "temp"] } } ] 1
[Tool(name='get_weather', title=None, description='Retrieves the temperature for a specified city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='set_weather', title=None, description='Sets the temperature for a specified city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'string'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None)] 1
[Tool(name='get_weather', title=None, description='Retrieve the current temperature for *city*.\n\nParameters\n----------\ncity : str\n Name of the city (case-insensitive).\n\nReturns\n-------\nfloat\n Temperature in °C. If the city was never written before,\n a random placeholder is generated so we always return a number.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='set_weather', title=None, description='Store or update the temperature for *city*.\n\nParameters\n----------\ncity : str\n Name of the city (case-insensitive).\ntemp : float\n Temperature in °C to associate with the city.\n\nReturns\n-------\nstr\n Always "OK" to signal success.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'string'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None)] 1
[ { "name": "get_weather", "description": "Retrieves the temperature for a specified city.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "Name of the city to get the weather for." } }, "required": ["city"], "additionalProperties": false } }, { "name": "set_weather", "description": "Sets the temperature for a specified city.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "Name of the city to set the weather for." }, "temp": { "type": "number", "description": "Temperature value to set for the city." } }, "required": ["city", "temp"], "additionalProperties": false } } ] 1
Available tools: [Tool(name='get_weather', title=None, description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='set_weather', title=None, description="Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'string'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None)] 1
Available tools: [Tool(name='get_weather_tool', title=None, description=None, inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='set_weather_tool', title=None, description=None, inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'string'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None)] Weather in Berlin: CallToolResult(content=[TextContent(type='text', text='20.0', annotations=None, meta=None)], structured_content={'result': 20.0}, data=20.0, is_error=False) Set weather response: CallToolResult(content=[TextContent(type='text', text='OK', annotations=None, meta=None)], structured_content={'result': 'OK'}, data='OK', is_error=False) Weather in Paris: CallToolResult(content=[TextContent(type='text', text='25.5', annotations=None, meta=None)], structured_content={'result': 25.5}, data=25.5, is_error=False) 1
[ { "name": "get_weather", "description": "Retrieves the temperature for a specified city", "parameters": { ... } }, { "name": "set_weather", "description": "Sets the temperature for a specified city", "parameters": { ... } } ] 1
ListToolsResult(meta=None, nextCursor=None, tools=[Tool(name='get_weather', title=None, description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='set_weather', title=None, description="Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema=None, annotations=None, meta=None)]) 1
Available tools: - get_weather: Get the temperature for a given city. Parameters: city (str): The name of the city to retrieve the temperature for. Returns: float: The temperature in Celsius. Returns a random value if the city is not found in the known data. - set_weather: Set the temperature for a given city. Parameters: city (str): The name of the city. temp (float): The temperature in Celsius to store for the city. Returns: None 1
[ { "name": "get_weather", "description": "Retrieves the temperature for a specified city.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city for which to retrieve weather data." } }, "required": ["city"] } }, { "name": "set_weather", "description": "Sets the temperature for a specified city.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city for which to set the weather data." }, "temp": { "type": "number", "description": "The temperature to associate with the city." } }, "required": ["city", "temp"] } } ] 1
[ { "function": { "name": "get_weather", "description": "Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city for which to retrieve weather data." } }, "required": [ "city" ] } } }, { "function": { "name": "set_weather", "description": "Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The name of the city for which to set the weather data." }, "temp": { "type": "number", "description": "The temperature to associate with the city." } }, "required": [ "city", "temp" ] } } } ] 1
[ Tool( name='get_weather', title=None, description='Retrieves the temperature for a specified city or region.', inputSchema={ 'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object' }, outputSchema={ 'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True }, annotations=None, meta=None ), Tool( name='set_weather', title=None, description='Sets the temperature for a specified city or region.', inputSchema={ 'properties': { 'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'} }, 'required': ['city', 'temp'], 'type': 'object' }, outputSchema={ 'properties': {'result': {'title': 'Result', 'type': 'string'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True }, annotations=None, meta=None ) ] 1
Available tools: ['get_weather', 'set_weather'] 1
I used the non-async MCP client to start the weather server and successfully listed the available tools. The MCP server responded with two tools: get_weather and set_weather, each with their parameters and descriptions 1
Available tools: [Tool(name='get_weather', title=None, description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='set_weather', title=None, description="Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'string'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None)] 🌤 Forecast in Berlin: 28.9 1
Available tools: [Tool(name='get_weather', title=None, description='Retrieves the temperature for a specified city.\nParameters:\n city (str): The name of the city for which to retrieve weather data.\nReturns:\n float: The temperature associated with the city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='set_weather', title=None, description="Sets the temperature for a specified city.\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\nReturns:\n str: A confirmation string 'OK' indicating successful update.", inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema=None, annotations=None, meta=None)] 1
import asyncio from fastmcp import Client import nest_asyncio # nest_asyncio allows the event loop to be nested, which is needed in environments like Jupyter # nest_asyncio.apply() async def main(): """ Connects to the weather_server and lists its available tools. """ # The client will run the weather_server.py script as a subprocess async with Client("weather_server.py") as mcp_client: tools = await mcp_client.list_tools() print(f"Available tools: {tools}") # In a Jupyter Notebook, you can run the async main function like this asyncio.run(main()) 1
Available Tools: [Tool(name='get_weather', title=None, description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='set_weather', title=None, description="Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema=None, annotations=None, meta=None)] 1
Berlin: CallToolResult(content=[TextContent(type='text', text='20.0', annotations=None, meta=None)], structured_content={'result': 20.0}, data=20.0, is_error=False)°C Set Germany weather: CallToolResult(content=[TextContent(type='text', text='OK', annotations=None, meta=None)], structured_content=None, data=None, is_error=False) Germany: CallToolResult(content=[TextContent(type='text', text='25.0', annotations=None, meta=None)], structured_content={'result': 25.0}, data=25.0, is_error=False)°C 1
[Tool(name='get_weather', title=None, description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta={'_fastmcp': {'tags': []}})] 1
tools/list -> [Tool(name='get_weather', title=None, description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta={'_fastmcp': {'tags': []}}), Tool(name='set_weather', title=None, description="Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'string'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta={'_fastmcp': {'tags': []}})] 1
tools = await mcp_client.list_tools() 1
[Tool(name='get_weather', title=None, description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='set_weather', title=None, description="Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'string'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='add', title=None, description='Add two numbers.', inputSchema={'properties': {'a': {'title': 'A', 'type': 'integer'}, 'b': {'title': 'B', 'type': 'integer'}}, 'required': ['a', 'b'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'integer'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None)] 1
[Tool(name='get_weather', title=None, description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='set_weather', title=None, description="Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'string'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='add', title=None, description='Add two numbers', inputSchema={'properties': {'a': {'title': 'A', 'type': 'integer'}, 'b': {'title': 'B', 'type': 'integer'}}, 'required': ['a', 'b'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'integer'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None)] 1
[ { "name": "get_weather", "title": null, "description": "Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.", "inputSchema": { "properties": { "city": { "title": "City", "type": "string" } }, "required": [ "city" ], "type": "object" }, "outputSchema": { "properties": { "result": { "title": "Result", "type": "number" } }, ... "annotations": null, "meta": null } ] 1
[Tool(name='get_weather', title=None, description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='set_weather', title=None, description="Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema=None, annotations=None, meta=None), Tool(name='get_known_weather_data', title=None, description='Retrieves the known weather data.\n\nReturns:\n dict: A dictionary containing city names as keys and their associated temperatures as values.', inputSchema={'properties': {}, 'type': 'object'}, outputSchema={'additionalProperties': True, 'type': 'object'}, annotations=None, meta=None)] 1
{ "jsonrpc": "2.0", "id": 2, "result": { "tools": [ { "name": "get_weather", "description": "Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.", "inputSchema": { "properties": { "city": { "title": "City", "type": "string" } }, "required": [ "city" ], "type": "object" }, "outputSchema": { "properties": { "result": { "title": "Result", "type": "number" } }, "required": [ "result" ], "title": "_WrappedResult", "type": "object", "x-fastmcp-wrap-result": true } }, { "name": "set_weather", "description": "Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", "inputSchema": { "properties": { "city": { "title": "City", "type": "string" }, "temp": { "title": "Temp", "type": "number" } }, "required": [ "city", "temp" ], "type": "object" } } ] } } 1
=== MCP Client Result === Number of tools: 3 Available tools: 1. add - Add two numbers 2. mcp_get_weather - Get weather for a city via MCP 3. mcp_set_weather - Set weather for a city via MCP 1
Available tools: name='get_weather' title=None description='Retrieve the temperature for a specific city.' inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'} outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True} annotations=None meta=None name='set_weather' title=None description='Set the temperature for a specific city.' inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'} outputSchema={'properties': {'result': {'title': 'Result', 'type': 'string'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True} annotations=None meta=None 1
Retrieving available tools... Available tools: ['add', 'get_weather', 'set_weather'] [{'name': 'add', 'description': 'Add two numbers', 'inputSchema': {'properties': {'a': {'title': 'A', 'type': 'integer'}, 'b': {'title': 'B', 'type': 'integer'}}, 'required': ['a', 'b'], 'type': 'object'}, 'outputSchema': {'properties': {'result': {'title': 'Result', 'type': 'integer'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}}, {'name': 'get_weather', 'description': 'Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', 'inputSchema': {'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, 'outputSchema': {'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}}, {'name': 'set_weather', 'description': "Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", 'inputSchema': {'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}}] 1
json\n[\n {\n \"name\": \"get_weather\",\n \"description\": \"Return the temperature (°C) for a given city.\",\n \"inputSchema\": {\"type\": \"object\", \"properties\": {\"city\": {\"type\": \"string\"}}, \"required\": [\"city\"]}\n },\n {\n \"name\": \"set_weather\",\n \"description\": \"Add or overwrite temperature for a city.\",\n \"inputSchema\": {\"type\": \"object\", \"properties\": {\"city\": {\"type\": \"string\"}, \"temp\": {\"type\": \"number\"}}, \"required\": [\"city\", \"temp\"]}\n }\n] 1
Tools found: [Tool(name='get_weather', title=None, description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='set_weather', title=None, description="Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'string'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None)] 1
get_weather – Retrieves the temperature for a specified city. set_weather – Sets the temperature for a specified city. 1
Available tools: - add: Add two numbers - get_weather: Retrieves the temperature for a specified city. Parameters: city (str): The name of the city for which to retrieve weather data. Returns: float: The temperature associated with the city. - set_weather: Sets the temperature for a specified city. Parameters: city (str): The name of the city for which to set the weather data. temp (float): The temperature to associate with the city. Returns: str: A confirmation string 'OK' indicating successful update. 1
Available tools: [Tool(name='get_weather_tool', description='\n Retrieves the temperature for a specified city.\n\n Parameters:\n city (str): The name of the city for which to retrieve weather data.\n\n Returns:\n float: The temperature associated with the city.\n ', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'title': 'get_weather_toolArguments', 'type': 'object'}), Tool(name='set_weather_tool', description="\n Sets the temperature for a specified city.\n\n Parameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\n Returns:\n str: A confirmation string 'OK' indicating successful update.\n ", inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'title': 'set_weather_toolArguments', 'type': 'object'})] 1
Available tools: - get_weather: Retrieves the temperature for a specified city. Parameters: city (str): The name of the city for which to retrieve weather data. Returns: float: The temperature associated with the city. - set_weather: Sets the temperature for a specified city. Parameters: city (str): The name of the city for which to set the weather data. temp (float): The temperature to associate with the city. Returns: str: A confirmation string 'OK' indicating successful update. Temperature in Berlin: 20.0 Answer set_weather: OK Temperature in Paris: 28.3 1
[Tool(name='get_weather', title=None, description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='set_weather', title=None, description="Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'string'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None)] 1
# Q6 what is the name of the tool? ans: get_weather our_mcp_client.get_tools() 1
Available tools: [Tool(name='get_weather', title=None, description='Get weather for a city', inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}, annotations=None, meta=None), Tool(name='set_weather', title=None, description=None, inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}, outputSchema=None, annotations=None, meta=None)] Berlin weather: CallToolResult(content=[TextContent(type='text', text='20.0', annotations=None, meta=None)], structured_content={'result': 20.0}, data=20.0, is_error=False) 1
[Tool(name='get_weather'), Tool(name='set_weather')] 1
weather_server.mcp 1
[{'name': 'get_weather', 'description': 'Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.', 'inputSchema': {'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}, 'outputSchema': {'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True}}, {'name': 'set_weather', 'description': "Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update.", 'inputSchema': {'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'}}] 1
Available Tools: name='get_weather' title=None description='Retrieves the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to retrieve weather data.\n\nReturns:\n float: The temperature associated with the city.' inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}}, 'required': ['city'], 'type': 'object'} outputSchema={'properties': {'result': {'title': 'Result', 'type': 'number'}}, 'required': ['result'], 'title': '_WrappedResult', 'type': 'object', 'x-fastmcp-wrap-result': True} annotations=None meta=None name='set_weather' title=None description="Sets the temperature for a specified city.\n\nParameters:\n city (str): The name of the city for which to set the weather data.\n temp (float): The temperature to associate with the city.\n\nReturns:\n str: A confirmation string 'OK' indicating successful update." inputSchema={'properties': {'city': {'title': 'City', 'type': 'string'}, 'temp': {'title': 'Temp', 'type': 'number'}}, 'required': ['city', 'temp'], 'type': 'object'} outputSchema=None annotations=None meta=None 1
https://github.com/clicksuku/SundarkpCode/blob/master/LLM%20Zoomcamp%202025/Agents/quotes_gen_mcp_client.py 1

Calculated: 12 September 2025, 19:18