Skip to content

Commit e5bb40b

Browse files
authored
Merge branch 'main' into prompts
2 parents ba299b6 + 56633f5 commit e5bb40b

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

src/strands_mcp_server/server.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ def search_docs(query: str, k: int = 5) -> List[Dict[str, Any]]:
2323
2424
**User Guide Topics:**
2525
- Agent concepts (agent loop, conversation management, hooks, prompts, state)
26-
- Model providers (Amazon Bedrock, Anthropic, Cohere, LiteLLM, LlamaAPI, MistralAI,
27-
Ollama, OpenAI, SageMaker, Writer)
26+
- Model providers (Amazon Bedrock, Anthropic, Cohere, LiteLLM, LlamaAPI,
27+
MistralAI, Ollama, OpenAI, SageMaker, Writer, Gemini)
2828
- Multi-agent patterns (Agent2Agent, Agents as Tools, Graph, Swarm, Workflow)
2929
- Tools (Python tools, MCP tools, community tools, executors)
3030
- Deployment guides (EC2, EKS, Fargate, Lambda, Bedrock AgentCore)
@@ -262,7 +262,7 @@ def strands_multiagent_development(
262262

263263

264264
@mcp.tool()
265-
def fetch_doc(uri: str) -> Dict[str, Any]:
265+
def fetch_doc(uri: str = "") -> Dict[str, Any]:
266266
"""Fetch full document content by URL.
267267
268268
Retrieves complete Strands Agents documentation content from URLs found via search_docs
@@ -279,18 +279,31 @@ def fetch_doc(uri: str) -> Dict[str, Any]:
279279
understanding or implementing Strands Agents features.
280280
281281
Args:
282-
uri: Document URI (supports http/https URLs)
282+
uri: Document URI (supports http/https URLs). If empty, returns all available URLs.
283283
284284
Returns:
285285
Dictionary containing:
286286
- url: Canonical document URL
287287
- title: Document title
288288
- content: Full document text content
289289
- error: Error message (if fetch failed)
290+
291+
Or when uri is empty:
292+
- urls: List of all available document URLs with titles
290293
291294
"""
292295
cache.ensure_ready()
293296

297+
# If no URI provided, return all available URLs (llms.txt catalog)
298+
if not uri:
299+
url_titles = cache.get_url_titles()
300+
return {
301+
"urls": [
302+
{"url": url, "title": title}
303+
for url, title in url_titles.items()
304+
]
305+
}
306+
294307
# Accept HTTP/HTTPS URLs
295308
if uri.startswith("http://") or uri.startswith("https://"):
296309
url = uri

0 commit comments

Comments
 (0)