@aws/nx-plugin-mcp 1.3.6 → 1.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/aws-nx-mcp.js
CHANGED
|
@@ -55783,8 +55783,8 @@ When scaffolding several projects in one go, chain generators to avoid a slow de
|
|
|
55783
55783
|
- **Chain generators** with \`&&\` in a single command. Pass \`--prefer-install-dependencies=false\` on each generator except the last so dependencies install once at the end, for example:
|
|
55784
55784
|
|
|
55785
55785
|
${PACKAGE_MANAGERS.map((pm) => ` \`\`\`bash
|
|
55786
|
-
${buildNxCommand("g @aws/nx-plugin:ts#
|
|
55787
|
-
${buildNxCommand("g @aws/nx-plugin:ts#
|
|
55786
|
+
${buildNxCommand("g @aws/nx-plugin:ts#api --no-interactive --name=my-app-api --framework=trpc --auth=iam --prefer-install-dependencies=false", pm)} && \\
|
|
55787
|
+
${buildNxCommand("g @aws/nx-plugin:ts#website --no-interactive --name=my-app-website --prefer-install-dependencies=false", pm)} && \\
|
|
55788
55788
|
${buildNxCommand("g @aws/nx-plugin:connection --no-interactive --sourceProject=@my-app/my-app-website --targetProject=@my-app/my-app-api --prefer-install-dependencies=false", pm)} && \\
|
|
55789
55789
|
${buildNxCommand("g @aws/nx-plugin:ts#infra --no-interactive --name=infra", pm)} && \\
|
|
55790
55790
|
${buildNxCommand("sync", pm)}
|
|
@@ -55814,7 +55814,7 @@ ${await fetchGuidePages([...GENERAL_GUIDANCE_PAGES], generators)}
|
|
|
55814
55814
|
*/
|
|
55815
55815
|
const addGeneratorGuideTool = (server, generators) => {
|
|
55816
55816
|
server.registerTool("generator-guide", {
|
|
55817
|
-
description: "Tool to retrieve detailed information about a specific generator. Pass `options` with the values you intend to use for any filterable option (e.g. infra, iac, auth, ux, protocol, sourceType, targetType) to receive only the guide content relevant to those choices — this cuts noise and avoids suggesting configuration from a different branch. The filterable keys and their valid values for each generator are listed by the `list-generators` tool; call it first if you are not sure which keys to pass. When the combination you pick is not supported by the generator (e.g. connection from ts#
|
|
55817
|
+
description: "Tool to retrieve detailed information about a specific generator. Pass `options` with the values you intend to use for any filterable option (e.g. infra, iac, auth, ux, protocol, sourceType, targetType) to receive only the guide content relevant to those choices — this cuts noise and avoids suggesting configuration from a different branch. The filterable keys and their valid values for each generator are listed by the `list-generators` tool; call it first if you are not sure which keys to pass. When the combination you pick is not supported by the generator (e.g. connection from a tRPC ts#api to a Smithy ts#api), the tool returns an \"Unsupported combination\" warning with the list of supported pairs. When `options` is omitted, every conditional section is included and prefixed with a `> [!NOTE] Only when …` marker so you can see the branching condition.",
|
|
55818
55818
|
inputSchema: {
|
|
55819
55819
|
packageManager: PackageManagerSchema,
|
|
55820
55820
|
generator: _enum(generators.map((g) => g.id)),
|
|
@@ -466,13 +466,19 @@ Let's take a look at some of the files in detail:
|
|
|
466
466
|
```python
|
|
467
467
|
# agent/agent.py
|
|
468
468
|
from contextlib import contextmanager
|
|
469
|
+
from datetime import UTC, datetime
|
|
469
470
|
|
|
470
471
|
from strands import Agent, tool
|
|
471
472
|
from strands.hooks import HookCallback, HookProvider
|
|
472
|
-
from strands_tools import current_time
|
|
473
473
|
from dungeon_adventure_agent_connection import log_model_errors, log_tool_errors
|
|
474
474
|
|
|
475
475
|
|
|
476
|
+
@tool
|
|
477
|
+
def current_time() -> str:
|
|
478
|
+
"""Get the current date and time in UTC (ISO 8601)."""
|
|
479
|
+
return datetime.now(UTC).isoformat()
|
|
480
|
+
|
|
481
|
+
|
|
476
482
|
@tool
|
|
477
483
|
def subtract(a: int, b: int) -> int:
|
|
478
484
|
return a - b
|
|
@@ -496,7 +502,7 @@ Refer to tools as your 'spellbook'.
|
|
|
496
502
|
)
|
|
497
503
|
```
|
|
498
504
|
|
|
499
|
-
This creates an example Strands agent and defines a subtraction tool. `log_model_errors` and `log_tool_errors` are hooks from the shared `dungeon_adventure_agent_connection` project that log model/tool failures instead of letting them fail silently.
|
|
505
|
+
This creates an example Strands agent and defines two tools: `current_time`, which returns the current UTC time, and a subtraction tool. `log_model_errors` and `log_tool_errors` are hooks from the shared `dungeon_adventure_agent_connection` project that log model/tool failures instead of letting them fail silently.
|
|
500
506
|
|
|
501
507
|
```python
|
|
502
508
|
# agent/middleware/session_id_middleware.py
|
package/docs/guides/py-agent.mdx
CHANGED
|
@@ -167,17 +167,23 @@ Define the tool, then add it to the `tools` list inside `get_agent()`:
|
|
|
167
167
|
|
|
168
168
|
<Tabs syncKey="agent-framework">
|
|
169
169
|
<TabItem label="Strands" _filter={{ framework: 'strands' }}>
|
|
170
|
-
```python title="packages/my-project/my_module/agent/agent.py" {
|
|
170
|
+
```python title="packages/my-project/my_module/agent/agent.py" {22-26,38}
|
|
171
171
|
from contextlib import contextmanager
|
|
172
|
+
from datetime import UTC, datetime
|
|
172
173
|
|
|
173
174
|
from strands import Agent, tool
|
|
174
175
|
from strands.hooks import HookCallback, HookProvider
|
|
175
|
-
from strands_tools import current_time
|
|
176
176
|
from my_scope_agent_connection import log_model_errors, log_tool_errors
|
|
177
177
|
|
|
178
178
|
from .session import get_session_manager
|
|
179
179
|
|
|
180
180
|
|
|
181
|
+
@tool
|
|
182
|
+
def current_time() -> str:
|
|
183
|
+
"""Get the current date and time in UTC (ISO 8601)."""
|
|
184
|
+
return datetime.now(UTC).isoformat()
|
|
185
|
+
|
|
186
|
+
|
|
181
187
|
@tool
|
|
182
188
|
def subtract(a: int, b: int) -> int:
|
|
183
189
|
return a - b
|
|
@@ -248,10 +254,10 @@ def get_agent():
|
|
|
248
254
|
|
|
249
255
|
<Tabs syncKey="agent-framework">
|
|
250
256
|
<TabItem label="Strands" _filter={{ framework: 'strands' }}>
|
|
251
|
-
Strands
|
|
257
|
+
The Strands SDK includes pre-built tools in `strands.vended_tools`, so they need no extra package. Import the tools you want and add them to `get_agent()`:
|
|
252
258
|
|
|
253
259
|
```python title="packages/my-project/my_module/agent/agent.py" {1,11}
|
|
254
|
-
from
|
|
260
|
+
from strands.vended_tools import http_request, read
|
|
255
261
|
|
|
256
262
|
# ...
|
|
257
263
|
|
|
@@ -261,11 +267,13 @@ def get_agent():
|
|
|
261
267
|
name="MyAgent",
|
|
262
268
|
description="MyAgent Strands Agent",
|
|
263
269
|
system_prompt="You are a helpful assistant.",
|
|
264
|
-
tools=[current_time,
|
|
270
|
+
tools=[current_time, read, http_request],
|
|
265
271
|
hooks=AGENT_HOOKS,
|
|
266
272
|
session_manager=get_session_manager(),
|
|
267
273
|
)
|
|
268
274
|
```
|
|
275
|
+
|
|
276
|
+
The `current_time` tool in this list is the one the generator defines in `agent.py`. The model calls it when it needs the date or time, and it returns the current UTC time. The generator does not add the deprecated `strands-agents-tools` package to `pyproject.toml`: from version 0.9.0, importing any of its tools raises an `ImportError`. If your project already lists it, keep it pinned below 0.9 or remove it if you do not use it. The [Strands migration guide](https://strandsagents.com/docs/user-guide/migrate/strands-agents-tools/) lists the replacement for each of its tools.
|
|
269
277
|
</TabItem>
|
|
270
278
|
<TabItem label="LangChain" _filter={{ framework: 'langchain' }}>
|
|
271
279
|
LangChain provides a large ecosystem of [tools and integrations](https://docs.langchain.com/oss/python/integrations/tools), each distributed in its own package. The generator does not add these, so install the one you need first — for example `langchain-community`, which the search tool below comes from:
|