Skip to content

Commit 2d280e5

Browse files
song-flyingXiang Song
andauthored
fix typo in code example on MCP tools (#103)
Co-authored-by: Xiang Song <xsongamz@amazon.com>
1 parent 9b0c761 commit 2d280e5

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

docs/user-guide/concepts/tools/tools_overview.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def get_user_location() -> str:
107107
@tool
108108
def weather(location: str) -> str:
109109
"""Get weather information for a location
110-
110+
111111
Args:
112112
location: City or location name
113113
"""
@@ -168,10 +168,10 @@ TOOL_SPEC = {
168168
def weather(tool: ToolUse, **kwargs: Any) -> ToolResult:
169169
tool_use_id = tool["toolUseId"]
170170
location = tool["input"]["location"]
171-
171+
172172
# Implement weather lookup logic here
173173
weather_info = f"Weather for {location}: Sunny, 72°F"
174-
174+
175175
return {
176176
"toolUseId": tool_use_id,
177177
"status": "success",
@@ -221,13 +221,13 @@ from strands.tools.mcp import MCPClient
221221
sse_mcp_client = MCPClient(lambda: sse_client("http://localhost:8000/sse"))
222222

223223
# Create an agent with MCP tools
224-
with sse_mcp_server:
224+
with sse_mcp_client:
225225
# Get the tools from the MCP server
226226
tools = sse_mcp_client.list_tools_sync()
227-
227+
228228
# Create an agent with the MCP server's tools
229229
agent = Agent(tools=tools)
230-
230+
231231
# Use the agent with MCP tools
232232
agent("Calculate the square root of 144")
233233
```
@@ -236,7 +236,7 @@ For more information on using MCP tools, see [MCP Tools](mcp-tools.md).
236236

237237
### 3. Example Built-in Tools
238238

239-
For rapid prototyping and common tasks, Strands offers an optional [example built-in tools package]({{ tools_repo }}) with pre-built tools for development. These tools cover a wide variety of capabilities including File Operations, Shell & Local System control, Web & Network for API calls, and Agents & Workflows for orchestration.
239+
For rapid prototyping and common tasks, Strands offers an optional [example built-in tools package]({{ tools_repo }}) with pre-built tools for development. These tools cover a wide variety of capabilities including File Operations, Shell & Local System control, Web & Network for API calls, and Agents & Workflows for orchestration.
240240

241241
For a complete list of available tools and their detailed descriptions, see [Example Built-in Tools](example-tools-package.md).
242242

@@ -261,13 +261,13 @@ Example of a well-described tool:
261261
def search_database(query: str, max_results: int = 10) -> list:
262262
"""
263263
Search the product database for items matching the query string.
264-
265-
Use this tool when you need to find detailed product information based on keywords,
266-
product names, or categories. The search is case-insensitive and supports fuzzy
264+
265+
Use this tool when you need to find detailed product information based on keywords,
266+
product names, or categories. The search is case-insensitive and supports fuzzy
267267
matching to handle typos and variations in search terms.
268-
269-
This tool connects to the enterprise product catalog database and performs a semantic
270-
search across all product fields, providing comprehensive results with all available
268+
269+
This tool connects to the enterprise product catalog database and performs a semantic
270+
search across all product fields, providing comprehensive results with all available
271271
product metadata.
272272
273273
Example response:
@@ -281,20 +281,20 @@ def search_database(query: str, max_results: int = 10) -> list:
281281
},
282282
...
283283
]
284-
284+
285285
Notes:
286286
- This tool only searches the product catalog and does not provide
287287
inventory or availability information
288288
- Results are cached for 15 minutes to improve performance
289289
- The search index updates every 6 hours, so very recent products may not appear
290290
- For real-time inventory status, use a separate inventory check tool
291-
291+
292292
Args:
293293
query: The search string (product name, category, or keywords)
294294
Example: "red running shoes" or "smartphone charger"
295295
max_results: Maximum number of results to return (default: 10, range: 1-100)
296296
Use lower values for faster response when exact matches are expected
297-
297+
298298
Returns:
299299
A list of matching product records, each containing:
300300
- id: Unique product identifier (string)
@@ -303,8 +303,7 @@ def search_database(query: str, max_results: int = 10) -> list:
303303
- price: Current price in USD (float)
304304
- category: Product category hierarchy (list)
305305
"""
306-
306+
307307
# Implementation
308308
pass
309309
```
310-

0 commit comments

Comments
 (0)