Skip to content

Commit b66138d

Browse files
Update Claude Code docs - 2025-09-12 | Updated: amazon-bedrock.md,sdk__custom-tools.md
1 parent 996afab commit b66138d

3 files changed

Lines changed: 81 additions & 43 deletions

File tree

docs/amazon-bedrock.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,4 +202,4 @@ Claude Code uses the Bedrock [Invoke API](https://docs.aws.amazon.com/bedrock/la
202202
* [Bedrock documentation](https://docs.aws.amazon.com/bedrock/)
203203
* [Bedrock pricing](https://aws.amazon.com/bedrock/pricing/)
204204
* [Bedrock inference profiles](https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles-support.html)
205-
* [Claude Code on Amazon Bedrock: Quick Setup Guide](https://community.aws/content/2tXkZKrZzlrlu0KfH8gST5Dkppq/claude-code-on-amazon-bedrock-quick-setup-guide)
205+
* [Claude Code on Amazon Bedrock: Quick Setup Guide](https://community.aws/content/2tXkZKrZzlrlu0KfH8gST5Dkppq/claude-code-on-amazon-bedrock-quick-setup-guide)- [Claude Code Monitoring Implementation (Bedrock)](https://github.com/aws-solutions-library-samples/guidance-for-claude-code-with-amazon-bedrock/blob/main/assets/docs/MONITORING.md)

docs/docs_manifest.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"amazon-bedrock.md": {
44
"original_url": "https://docs.anthropic.com/en/docs/claude-code/amazon-bedrock",
55
"original_md_url": "https://docs.anthropic.com/en/docs/claude-code/amazon-bedrock.md",
6-
"hash": "1ca788545bdb7f20edfd73977a3a7ea693a465e52ef50179215192141f2d0826",
7-
"last_updated": "2025-09-10T21:04:03.195628"
6+
"hash": "7e9b2e9ed6f791054149cd38e0ae942e656d0b7aafb2442c18ff6b57c5de6e10",
7+
"last_updated": "2025-09-12T21:03:48.886300"
88
},
99
"analytics.md": {
1010
"original_url": "https://docs.anthropic.com/en/docs/claude-code/analytics",
@@ -153,8 +153,8 @@
153153
"sdk__custom-tools.md": {
154154
"original_url": "https://docs.anthropic.com/en/docs/claude-code/sdk/custom-tools",
155155
"original_md_url": "https://docs.anthropic.com/en/docs/claude-code/sdk/custom-tools.md",
156-
"hash": "3e6e3899afe967c87f77822f6268daea1cd6374f1ef2fa1d827913d57b92f11c",
157-
"last_updated": "2025-09-12T18:05:47.146920"
156+
"hash": "7cb3754f5c50f5868eea8f27f285551f6fe194d860be433926d5308906572504",
157+
"last_updated": "2025-09-12T21:04:02.074662"
158158
},
159159
"sdk__modifying-system-prompts.md": {
160160
"original_url": "https://docs.anthropic.com/en/docs/claude-code/sdk/modifying-system-prompts",
@@ -297,8 +297,8 @@
297297
}
298298
},
299299
"fetch_metadata": {
300-
"last_fetch_completed": "2025-09-12T18:05:59.204804",
301-
"fetch_duration_seconds": 27.992173,
300+
"last_fetch_completed": "2025-09-12T21:04:13.921454",
301+
"fetch_duration_seconds": 26.542223,
302302
"total_pages_discovered": 48,
303303
"pages_fetched_successfully": 49,
304304
"pages_failed": 0,
@@ -308,7 +308,7 @@
308308
"total_files": 49,
309309
"fetch_tool_version": "3.0"
310310
},
311-
"last_updated": "2025-09-12T18:05:59.204826",
311+
"last_updated": "2025-09-12T21:04:13.921484",
312312
"base_url": "https://raw.githubusercontent.com/mnestorov/cc-docs-mirror/main/docs/",
313313
"github_repository": "mnestorov/cc-docs-mirror",
314314
"github_ref": "main",

docs/sdk__custom-tools.md

Lines changed: 73 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ Use the `createSdkMcpServer` and `tool` helper functions to define type-safe cus
8080

8181
Pass the custom server to the `query` function via the `mcpServers` option as a dictionary/object.
8282

83+
<Note>
84+
**Important:** Custom MCP tools require streaming input mode. You must use an async generator/iterable for the `prompt` parameter - a simple string will not work with MCP servers.
85+
</Note>
86+
8387
### Tool Name Format
8488

8589
When MCP tools are exposed to Claude, their names follow a specific format:
@@ -95,9 +99,19 @@ You can control which tools Claude can use via the `allowedTools` option:
9599
```typescript TypeScript
96100
import { query } from "@anthropic-ai/claude-code";
97101

98-
// Use the custom tools in your query
102+
// Use the custom tools in your query with streaming input
103+
async function* generateMessages() {
104+
yield {
105+
type: "user" as const,
106+
message: {
107+
role: "user" as const,
108+
content: "What's the weather in San Francisco?"
109+
}
110+
};
111+
}
112+
99113
for await (const message of query({
100-
prompt: "What's the weather in San Francisco?",
114+
prompt: generateMessages(), // Use async generator for streaming input
101115
options: {
102116
mcpServers: {
103117
"my-custom-tools": customServer // Pass as object/dictionary, not array
@@ -119,23 +133,30 @@ You can control which tools Claude can use via the `allowedTools` option:
119133
```python Python
120134
from claude_code_sdk import ClaudeSDKClient, ClaudeCodeOptions
121135

122-
# Use the custom tools in your query
123-
options = ClaudeCodeOptions(
124-
mcp_servers={"my-custom-tools": custom_server}, # Pass as dict, not list
125-
# Optionally specify which tools Claude can use
126-
allowed_tools=[
127-
"mcp__my-custom-tools__get_weather", # Allow the weather tool
128-
# Add other tools as needed
129-
],
130-
max_turns=3
131-
)
136+
# Use the custom tools in your query with streaming input
137+
async def message_generator():
138+
yield {
139+
"type": "user",
140+
"message": {
141+
"role": "user",
142+
"content": "What's the weather in San Francisco?"
143+
}
144+
}
132145

133-
async with ClaudeSDKClient(options=options) as client:
134-
await client.query("What's the weather in San Francisco?")
135-
136-
# Extract and print response
137-
async for msg in client.receive_response():
138-
print(msg)
146+
async for message in query(
147+
prompt=message_generator(), # Use async generator for streaming input
148+
options=ClaudeCodeOptions(
149+
mcp_servers={"my-custom-tools": custom_server}, # Pass as dict, not list
150+
# Optionally specify which tools Claude can use
151+
allowed_tools=[
152+
"mcp__my-custom-tools__get_weather", # Allow the weather tool
153+
# Add other tools as needed
154+
],
155+
max_turns=3
156+
)
157+
):
158+
if hasattr(message, 'result'):
159+
print(message.result)
139160
```
140161
</CodeGroup>
141162

@@ -155,9 +176,19 @@ When your MCP server has multiple tools, you can selectively allow them:
155176
]
156177
});
157178

158-
// Allow only specific tools
179+
// Allow only specific tools with streaming input
180+
async function* generateMessages() {
181+
yield {
182+
type: "user" as const,
183+
message: {
184+
role: "user" as const,
185+
content: "Calculate 5 + 3 and translate 'hello' to Spanish"
186+
}
187+
};
188+
}
189+
159190
for await (const message of query({
160-
prompt: "Calculate 5 + 3 and translate 'hello' to Spanish",
191+
prompt: generateMessages(), // Use async generator for streaming input
161192
options: {
162193
mcpServers: {
163194
utilities: multiToolServer
@@ -198,22 +229,29 @@ When your MCP server has multiple tools, you can selectively allow them:
198229
tools=[calculate, translate, search_web] # Pass decorated functions
199230
)
200231

201-
# Allow only specific tools
202-
options = ClaudeCodeOptions(
203-
mcp_servers={"utilities": multi_tool_server},
204-
allowed_tools=[
205-
"mcp__utilities__calculate", # Allow calculator
206-
"mcp__utilities__translate", # Allow translator
207-
# "mcp__utilities__search_web" is NOT allowed
208-
]
209-
)
232+
# Allow only specific tools with streaming input
233+
async def message_generator():
234+
yield {
235+
"type": "user",
236+
"message": {
237+
"role": "user",
238+
"content": "Calculate 5 + 3 and translate 'hello' to Spanish"
239+
}
240+
}
210241

211-
async with ClaudeSDKClient(options=options) as client:
212-
await client.query("Calculate 5 + 3 and translate 'hello' to Spanish")
213-
214-
# Extract and print response
215-
async for msg in client.receive_response():
216-
print(msg)
242+
async for message in query(
243+
prompt=message_generator(), # Use async generator for streaming input
244+
options=ClaudeCodeOptions(
245+
mcp_servers={"utilities": multi_tool_server},
246+
allowed_tools=[
247+
"mcp__utilities__calculate", # Allow calculator
248+
"mcp__utilities__translate", # Allow translator
249+
# "mcp__utilities__search_web" is NOT allowed
250+
]
251+
)
252+
):
253+
if hasattr(message, 'result'):
254+
print(message.result)
217255
```
218256
</CodeGroup>
219257

0 commit comments

Comments
 (0)