@noodleseed/agent-kit 0.15.0 → 0.16.0

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/manifest.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
- "packageVersion": "0.15.0",
2
+ "packageVersion": "0.16.0",
3
3
  "files": [
4
4
  {
5
5
  "path": "skills/codex/SKILL.md",
6
- "sha256": "3dfbb3af5b9176302b787da3118896d4cc4b4382c674b68f956ef2d52f5adbf6",
6
+ "sha256": "5a709e078dbc9e5ab9194e35e1cef93936c62f2c4e826877028ec269162d9b7c",
7
7
  "agentTarget": "codex"
8
8
  },
9
9
  {
@@ -33,7 +33,7 @@
33
33
  },
34
34
  {
35
35
  "path": "skills/codex/references/connect-an-api.md",
36
- "sha256": "5c7d763ad57e6d6b67e3e115da48acd5bef3687acd050b776416906076cec440",
36
+ "sha256": "890dd3a73a73e29f0cad88d1fb1b4ebc24791b791cfffb130143b26f714e9da0",
37
37
  "agentTarget": "codex"
38
38
  },
39
39
  {
@@ -53,7 +53,7 @@
53
53
  },
54
54
  {
55
55
  "path": "skills/codex/references/troubleshooting.md",
56
- "sha256": "834d2c6626dc90c009aebac3ee7ff8977a1f97dfb66cf5b955fd6414e6e2a897",
56
+ "sha256": "b08dc48e72fa186fc953cf7052bfb7500b4586a772a1f4c54ff1e53a29f21eb2",
57
57
  "agentTarget": "codex"
58
58
  },
59
59
  {
@@ -73,7 +73,7 @@
73
73
  },
74
74
  {
75
75
  "path": "skills/codex/references/examples.md",
76
- "sha256": "7bef744d11a33f445d316e145d268035a29d108e5159c7de62899e6364840106",
76
+ "sha256": "bd19dead1f7b1b6610a53694a06569d3c71d149bd6c72c4a1c94c83ded13a34f",
77
77
  "agentTarget": "codex"
78
78
  },
79
79
  {
@@ -323,7 +323,7 @@
323
323
  },
324
324
  {
325
325
  "path": "skills/codex/examples/weather/README.md",
326
- "sha256": "cdad82399028f275e5ac5fabd35d373f5673839171302128ed066e3adacd6ed6",
326
+ "sha256": "59dd103ae387b4ef0f32e155dbe9a11d79e260310a07c0f266a16add2e8e31bd",
327
327
  "agentTarget": "codex"
328
328
  },
329
329
  {
@@ -338,17 +338,17 @@
338
338
  },
339
339
  {
340
340
  "path": "skills/codex/examples/weather/src/server.ts",
341
- "sha256": "ba1ef62597885a2ec89e8c02d593bfa277763fd3a3af2154e9d1b72b06eb58f1",
341
+ "sha256": "4af1ea8c9ed5d41456bfa52b4b0245a3d482f4a95ef4e994b2758dd32c1c52ce",
342
342
  "agentTarget": "codex"
343
343
  },
344
344
  {
345
345
  "path": "skills/codex/examples/weather/test/server.test.ts",
346
- "sha256": "25047bd0c8d00c33ed485eb62b2893a7374074e9a793ca855c20a93a5fbb82d5",
346
+ "sha256": "6753e4db274b00d2e92405040a27609a15087227de7b13f9e9f9e19c12d3a255",
347
347
  "agentTarget": "codex"
348
348
  },
349
349
  {
350
350
  "path": "skills/claude-code/SKILL.md",
351
- "sha256": "b2ca82b392a9a03841db8249d5fabde456c08209c6bc3ac29679fbf5cc9dbeaa",
351
+ "sha256": "0a3e1998439a89d14887c9e533a225e7f83dbfdedffd278eb773213d3758e469",
352
352
  "agentTarget": "claude-code"
353
353
  },
354
354
  {
@@ -378,7 +378,7 @@
378
378
  },
379
379
  {
380
380
  "path": "skills/claude-code/references/connect-an-api.md",
381
- "sha256": "5c7d763ad57e6d6b67e3e115da48acd5bef3687acd050b776416906076cec440",
381
+ "sha256": "890dd3a73a73e29f0cad88d1fb1b4ebc24791b791cfffb130143b26f714e9da0",
382
382
  "agentTarget": "claude-code"
383
383
  },
384
384
  {
@@ -398,7 +398,7 @@
398
398
  },
399
399
  {
400
400
  "path": "skills/claude-code/references/troubleshooting.md",
401
- "sha256": "834d2c6626dc90c009aebac3ee7ff8977a1f97dfb66cf5b955fd6414e6e2a897",
401
+ "sha256": "b08dc48e72fa186fc953cf7052bfb7500b4586a772a1f4c54ff1e53a29f21eb2",
402
402
  "agentTarget": "claude-code"
403
403
  },
404
404
  {
@@ -418,7 +418,7 @@
418
418
  },
419
419
  {
420
420
  "path": "skills/claude-code/references/examples.md",
421
- "sha256": "7bef744d11a33f445d316e145d268035a29d108e5159c7de62899e6364840106",
421
+ "sha256": "bd19dead1f7b1b6610a53694a06569d3c71d149bd6c72c4a1c94c83ded13a34f",
422
422
  "agentTarget": "claude-code"
423
423
  },
424
424
  {
@@ -668,7 +668,7 @@
668
668
  },
669
669
  {
670
670
  "path": "skills/claude-code/examples/weather/README.md",
671
- "sha256": "cdad82399028f275e5ac5fabd35d373f5673839171302128ed066e3adacd6ed6",
671
+ "sha256": "59dd103ae387b4ef0f32e155dbe9a11d79e260310a07c0f266a16add2e8e31bd",
672
672
  "agentTarget": "claude-code"
673
673
  },
674
674
  {
@@ -683,12 +683,12 @@
683
683
  },
684
684
  {
685
685
  "path": "skills/claude-code/examples/weather/src/server.ts",
686
- "sha256": "ba1ef62597885a2ec89e8c02d593bfa277763fd3a3af2154e9d1b72b06eb58f1",
686
+ "sha256": "4af1ea8c9ed5d41456bfa52b4b0245a3d482f4a95ef4e994b2758dd32c1c52ce",
687
687
  "agentTarget": "claude-code"
688
688
  },
689
689
  {
690
690
  "path": "skills/claude-code/examples/weather/test/server.test.ts",
691
- "sha256": "25047bd0c8d00c33ed485eb62b2893a7374074e9a793ca855c20a93a5fbb82d5",
691
+ "sha256": "6753e4db274b00d2e92405040a27609a15087227de7b13f9e9f9e19c12d3a255",
692
692
  "agentTarget": "claude-code"
693
693
  }
694
694
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noodleseed/agent-kit",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "private": false,
5
5
  "description": "Self-checking, self-updating agent skills for the Noodle Seed CLI. Authored in this repo by @noodle-borg/agent-kit; this is the published, independently-versioned canonical skills artifact the CLI fetches and verifies.",
6
6
  "license": "Apache-2.0",
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  name: noodle-seed
3
3
  description: Use when building, validating, testing, deploying, or operating a local or hosted Noodle Seed MCP server or app authored in TypeScript with the noodle CLI.
4
- version: 0.15.0
5
- hash: dc338e17bb0de722
4
+ version: 0.16.0
5
+ hash: b4952708b1c38f55
6
6
  ---
7
7
 
8
8
  # Noodle Seed
@@ -15,6 +15,8 @@ Use this skill for project-local Noodle Seed authoring in Claude Code; preserve
15
15
 
16
16
  This CLI is agent-native: the cold-agent-path commands speak the `--json` envelope (hosted admin/ops commands are still being normalized). Drive the loop by parsing machine state, not human prose. The full envelope, exit codes, and output modes are in `references/agent-contract.md`.
17
17
 
18
+ **Discover the skill first.** Before authoring anything, read this whole `SKILL.md` and scan the `## References` index below (including `references/examples.md`) so you build from the shipped patterns — connectors that return live lists, secret scoping, widgets, testing — instead of rediscovering them. Open the references your task touches in full.
19
+
18
20
  Before authoring, design the experience — the funnel/handoff boundary, tools, widgets, display modes, and grounding — see `references/experience-design.md`. Then run the loop:
19
21
 
20
22
  1. **Discover** — `noodle commands --json`: every command, subcommand, flag, and exit code (don't read source).
@@ -22,7 +24,7 @@ Before authoring, design the experience — the funnel/handoff boundary, tools,
22
24
  3. **Validate** — `noodle validate --json`; on failure `{ok:false,error:{code,message,fix,next,errors:[{code,path,message}]}}` — the per-field detail is in `error.errors[]`.
23
25
  4. **Repair** — fix each `error.errors[]` entry at its `path`, then re-run `noodle validate --json`; `noodle validate --fix-prompt` emits ready-to-apply repair prose. Never freeform re-edit (see `references/compile-errors.md`).
24
26
  5. **Smoke** — `noodle test --json`: local compile plus a loopback MCP smoke.
25
- 6. **Prove real output** — `validate`/`test` prove a connector tool *compiles and registers*, not that its response mapping returns data. Set the secret locally (`noodle secrets set <NAME> --from-env <ENV>`), then run a live read — `noodle tools call <read_tool> --args '{...}'` executes the connector against the real API in-process — and confirm the mapped fields are populated, not `undefined`, before trusting it. Only run a live write if it is safe/approved.
27
+ 6. **Prove real output** — `validate`/`test` prove a connector tool *compiles and registers*, not that its response mapping returns data. Set the secret at the scope your local `noodle dev` resolves (`noodle secrets set <NAME> --runtime local --scope org --org local --from-env <ENV>`; a secret set at the wrong scope leaves the loopback returning `-32600 "not found"` — see `references/connect-an-api.md`), then run a live read — `noodle tools call <read_tool> --args '{...}'` executes the connector against the real API in-process — and confirm the mapped fields are populated, not `undefined`, before trusting it. Only run a live write if it is safe/approved.
26
28
  7. **Apps/widgets** — `noodle check --json` (add `--target chatgpt|claude`), then `noodle devtools` (see `references/widgets-and-apps.md`).
27
29
  8. **Deploy** — `noodle deploy`; auth fails clean with `error.next` = `noodle login` (see `references/deploy-and-ops.md`).
28
30
  9. **Wire into a host** — `noodle connect <codex|claude-code|chatgpt>` (prove it in a real host per `references/test-in-hosts.md`; debug symptoms with `references/troubleshooting.md`).
@@ -30,7 +32,7 @@ Before authoring, design the experience — the funnel/handoff boundary, tools,
30
32
 
31
33
  ## References
32
34
 
33
- Load these on demand:
35
+ Scan all of these during discovery; open in full the ones your task touches:
34
36
 
35
37
  - `references/agent-contract.md` — the `--json` envelope, exit codes, and the three output modes.
36
38
  - `references/sdk-surface.md` — what to import from `@noodleseed/one` and which builder to use.
@@ -1,15 +1,22 @@
1
1
  # Weather Briefing
2
2
 
3
- A single declarative tool that shows the runtime's breadth working together, with **no auth and no API
3
+ Two declarative tools that show the runtime's breadth working together, with **no auth and no API
4
4
  keys**. The `weather_briefing` tool takes a city name and runs a **three-step flow**:
5
5
 
6
- Capability slots: HTTP connector authoring, ordered fulfilment flows, query/response mapping, and sandboxed
7
- compute.
6
+ Capability slots: HTTP connector authoring, ordered fulfilment flows, query/response mapping,
7
+ **list-returning connector output** (a connector that returns a live, variable-length array), and
8
+ sandboxed compute.
8
9
 
9
10
  1. **`geo.search`** → geocode the city to coordinates (Open-Meteo Geocoding API)
10
11
  2. **`forecast.current`** → fetch current weather for those coordinates (Open-Meteo Forecast API)
11
12
  3. **`brief.summarize`** → derive a human-readable briefing in a **WASM/QuickJS compute sandbox**
12
13
 
14
+ The second tool, `search_places`, shows a connector returning a **live, variable-length list**: it binds
15
+ the whole Open-Meteo geocoding `results` array with `${response.results}`, then narrows each match to
16
+ `{ id, label }` in a compute connector — the "search → a list of options the model can pick from"
17
+ pattern. Narrowing lives in compute because a `${...}` response mapping cannot iterate an array and a
18
+ tool's Zod output does not strip fields at runtime.
19
+
13
20
  It exercises, in one TypeScript-authored app:
14
21
 
15
22
  - **Server-level branding** with semantic tokens carried through the runtime artifact for any generated
@@ -17,8 +24,12 @@ It exercises, in one TypeScript-authored app:
17
24
  - **Ordered flow execution** with outputs threaded between steps (`${steps.geo.latitude}` → next step).
18
25
  - **Two HTTP connectors on two different hosts**, each with its own egress allowlist.
19
26
  - **Query parameters** (`query: [...]`) and a constant query baked into the path (`?current_weather=true`).
20
- - **Deep response mapping** with the `${...}` language (`${response.results[0].latitude}`,
21
- `${response.current_weather.temperature}`).
27
+ - **Deep response mapping** with the `${...}` language — single-element indexing
28
+ (`${response.results[0].latitude}`, `${response.current_weather.temperature}`) **and** whole-array
29
+ binding (`${response.results}` returns the entire list verbatim).
30
+ - **A list-returning connector + compute narrowing** — `geo.search_list` binds the whole `results`
31
+ array; `places.narrow` reduces each element to `{ id, label }` and normalizes the no-results case
32
+ to `[]`.
22
33
  - **Sandboxed compute** (no network/fs/env/clock) turning raw numbers into conditions + advice.
23
34
  - **Typed input/output schemas** emitted as JSON Schema 2020-12.
24
35
 
@@ -52,3 +63,23 @@ Example result (live data, abbreviated):
52
63
  ```
53
64
 
54
65
  Try other cities (`Reykjavik`, `Singapore`, `Denver`) to see the conditions and advice change.
66
+
67
+ Call `search_places` to see the **list-returning** tool — one query, many matches:
68
+
69
+ ```bash
70
+ curl -s "$URL" \
71
+ -H 'content-type: application/json' \
72
+ -H 'accept: application/json, text/event-stream' \
73
+ -H 'mcp-protocol-version: 2025-11-25' \
74
+ -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"search_places","arguments":{"query":"Springfield"}}}'
75
+ ```
76
+
77
+ ```json
78
+ {
79
+ "places": [
80
+ { "id": "4951788", "label": "Springfield, Massachusetts, United States" },
81
+ { "id": "4250542", "label": "Springfield, Illinois, United States" },
82
+ { "id": "4508722", "label": "Springfield, Ohio, United States" }
83
+ ]
84
+ }
85
+ ```
@@ -33,6 +33,28 @@ const geocoding = connector('open_meteo_geocoding')
33
33
  country: '${response.results[0].country}',
34
34
  },
35
35
  },
36
+ // A LIST-returning read. `${response.results}` binds the WHOLE array verbatim — a
37
+ // variable-length list of place objects — with no pagination (Open-Meteo returns every match in
38
+ // one page). Contrast the `search` op above, which indexes a single element (`results[0]`). To
39
+ // reduce each element to a few fields, narrow it in the `geo_places` compute connector below: a
40
+ // response mapping cannot iterate an array, and a tool's Zod output does not strip fields at
41
+ // runtime.
42
+ search_list: {
43
+ type: 'read',
44
+ method: 'GET',
45
+ path: '/v1/search',
46
+ query: ['name', 'count'],
47
+ input: {
48
+ name: { type: 'string', required: true },
49
+ count: { type: 'number' },
50
+ },
51
+ output: {
52
+ results: { type: 'array' },
53
+ },
54
+ response: {
55
+ results: '${response.results}',
56
+ },
57
+ },
36
58
  },
37
59
  });
38
60
 
@@ -132,12 +154,44 @@ const brief = connector('weather_brief')
132
154
  },
133
155
  });
134
156
 
157
+ // Narrowing a live list to `{ id, label }` summaries is the ONE reshape a response mapping cannot do
158
+ // (the `${...}` language has no per-item iteration) and a tool's Zod output does not enforce at runtime
159
+ // — so it happens here, in a sandboxed compute connector (a connector is HTTP or compute, not both).
160
+ // This also normalizes the no-results case (Open-Meteo omits `results` when nothing matches) to `[]`.
161
+ const placeNarrow = connector('geo_places')
162
+ .version('1.0.0')
163
+ .compute('narrow', {
164
+ type: 'read',
165
+ input: {
166
+ results: { type: 'unknown' },
167
+ },
168
+ output: {
169
+ places: { type: 'array', required: true },
170
+ },
171
+ // Self-contained: no imports, no closure over outer variables, synchronous.
172
+ run: (input) => {
173
+ const raw = input.results;
174
+ const list = Array.isArray(raw) ? raw : [];
175
+ const places = list.map((entry) => {
176
+ const parts = [entry.name, entry.admin1, entry.country].filter(
177
+ (part) => typeof part === 'string' && part.length > 0,
178
+ );
179
+ const id =
180
+ entry.id !== undefined && entry.id !== null
181
+ ? String(entry.id)
182
+ : `${entry.latitude},${entry.longitude}`;
183
+ return { id, label: parts.join(', ') };
184
+ });
185
+ return { places };
186
+ },
187
+ });
188
+
135
189
  export default server(
136
190
  'weather_briefing',
137
191
  {
138
192
  title: 'Weather Briefing',
139
193
  version: '1.0.0',
140
- use: { geo: geocoding, forecast, brief },
194
+ use: { geo: geocoding, forecast, brief, places: placeNarrow },
141
195
  branding: {
142
196
  name: 'Weather Briefing',
143
197
  accent: '#0284C7',
@@ -186,5 +240,22 @@ export default server(
186
240
  };
187
241
  },
188
242
  }),
243
+ // A connector that returns a live, variable-length LIST: search a place name, get back the
244
+ // matching locations as `{ id, label }` options the model can resolve against. The HTTP op binds
245
+ // the whole array; the compute connector narrows each element to the two fields the model speaks
246
+ // from. Append new tools AFTER existing ones so `tools[0]` stays stable for host harnesses.
247
+ tool('search_places', {
248
+ description:
249
+ 'Search a place name and return the matching locations as a list of { id, label } options.',
250
+ input: z.object({ query: z.string() }),
251
+ output: z.object({
252
+ places: z.array(z.object({ id: z.string(), label: z.string() })),
253
+ }),
254
+ fulfil: ({ input, connectors }) => {
255
+ const found = connectors.geo.search_list({ name: input.query });
256
+ const narrowed = connectors.places.narrow({ results: found.results });
257
+ return { places: narrowed.places };
258
+ },
259
+ }),
189
260
  ],
190
261
  );
@@ -5,4 +5,25 @@ describe('weather example', () => {
5
5
  it('exports a Noodle server definition', () => {
6
6
  expect(typeof app.toManifest).toBe('function');
7
7
  });
8
+
9
+ it('adds a list-returning search_places tool without disturbing tool order', async () => {
10
+ const manifest = (await app.toManifest()) as {
11
+ tools: ReadonlyArray<{ name: string }>;
12
+ connectors?: Record<string, { id: string; version: string }>;
13
+ };
14
+ const toolNames = manifest.tools.map((t) => t.name);
15
+ // The original briefing tool stays first — host harnesses (the online e2e) read `tools[0]`,
16
+ // so new tools are appended, never prepended.
17
+ expect(toolNames[0]).toBe('weather_briefing');
18
+ expect(toolNames).toContain('search_places');
19
+ expect(toolNames.indexOf('search_places')).toBeGreaterThan(
20
+ toolNames.indexOf('weather_briefing'),
21
+ );
22
+ // The list is produced by a whole-array-bind HTTP op (`search_list`) narrowed to {id,label}
23
+ // through a separate compute connector (`geo_places`).
24
+ expect(manifest.connectors?.places).toEqual({ id: 'geo_places', version: '1.0.0' });
25
+ const wire = JSON.stringify(manifest);
26
+ expect(wire).toContain('search_list');
27
+ expect(wire).toContain('narrow');
28
+ });
8
29
  });
@@ -8,7 +8,10 @@ drift. Probe the live API, learn the real shape, then encode it as a `connector`
8
8
  - Secure the key first
9
9
  - Probe the live API
10
10
  - Model the connector from the observed shape
11
+ - Return a list
12
+ - Create, update, delete
11
13
  - Design intent tools
14
+ - Set the secret for local runs
12
15
  - Prove real output
13
16
  - Then build the app
14
17
 
@@ -19,7 +22,7 @@ managed secret and reference it only as `secret(...)`:
19
22
 
20
23
  ```sh
21
24
  export SOME_API_KEY=… # the user sets this; it never appears in a file or prompt
22
- noodle secrets set SOME_API_KEY --from-env SOME_API_KEY
25
+ noodle secrets set SOME_API_KEY --runtime local --scope org --org local --from-env SOME_API_KEY # local-run scope — see "Set the secret for local runs"
23
26
  ```
24
27
 
25
28
  In `server.ts` the key is only ever `secret("SOME_API_KEY")` — keep the raw value out of code, tests,
@@ -53,6 +56,51 @@ Encode the API as an HTTP connector, mapping only the fields you actually saw in
53
56
  The full connector shape, every `auth.kind`, and compute connectors are in
54
57
  `references/authoring-workflow.md`.
55
58
 
59
+ ## Return a list
60
+
61
+ Most real tools return a variable-length list (search results, a user’s tasks). Bind the **whole array** — a single `${response.path}` returns the referenced value verbatim, arrays included:
62
+
63
+ ```ts
64
+ // The API returns { results: [ { id, name, country, … }, … ] }
65
+ output: { places: { type: 'array' } },
66
+ response: { places: '${response.results}' },
67
+ ```
68
+
69
+ Three things that are easy to get subtly wrong:
70
+
71
+ - **A response mapping cannot iterate.** There is no per-item / `map` / `item` construct, so you cannot reshape `[{…30 fields}]` into `[{ id, label }]` inside a `response:` block — bind the whole array.
72
+ - **A tool's Zod `output` does not strip at runtime.** It only advertises the JSON Schema; the runtime returns your `fulfil` output verbatim, so `z.array(z.object({ id, label }))` will NOT drop extra element fields.
73
+ - **So narrow in a compute connector.** To reshape each element, synthesize a `label`, or normalize a missing array to `[]`, pass the whole array to a `.compute(...)` op whose `run` maps it (a connector is HTTP **or** compute, not both — use a second connector). To only *drop* known fields without reshaping, `projection: { hiddenFields: [...] }` deletes them from each element. Worked example: `examples/weather` — `search_list` binds the array, then `geo_places.narrow` reshapes to `{ id, label }` and normalizes no-results to `[]`; `examples/sharepoint-lists` shows the same pattern against a real API.
74
+
75
+ For a **paginated** API, collect across pages with a `pagination` config; the collected list is then `${response.items}`:
76
+
77
+ ```ts
78
+ pagination: {
79
+ kind: 'cursor', // or 'pageNumber'
80
+ items: '${response.results}', // the array on ONE page
81
+ nextCursor: '${response.next_cursor}', // 'pageNumber' uses hasMore + pageParam instead
82
+ cursorParam: 'cursor',
83
+ maxPages: 5, maxItems: 100,
84
+ },
85
+ // items / nextCursor / hasMore run over ONE raw page; your response mapping runs over the
86
+ // collected aggregate, so the full list is:
87
+ response: { tasks: '${response.items}' },
88
+ ```
89
+
90
+ ## Create, update, delete
91
+
92
+ Pair the read/list with the mutations your intent tools need:
93
+ - **Create / update** — `method: 'POST'` / `'PATCH'`; the request body is authored as `request: { field: '${input.x}' }` — the `request` object **is** the JSON body (do not nest it under `body`), and URL query params are the operation-level `query: [...]` array.
94
+ - **Delete / close** — many endpoints return `204 No Content`. Set `responseType: 'empty'`, which enforces the status and binds `{}` (there is no body to map).
95
+
96
+ ```ts
97
+ close_task: {
98
+ type: 'action', method: 'POST', path: '/tasks/{id}/close',
99
+ input: { id: { type: 'string', required: true } },
100
+ responseType: 'empty',
101
+ },
102
+ ```
103
+
56
104
  ## Design intent tools
57
105
 
58
106
  Shape tools around what the user says, not 1:1 around endpoints. Pair an id-taking action with a
@@ -60,6 +108,20 @@ find/search operation that returns `{ id, label }` summaries so the model resolv
60
108
  and map each response to a few labelled fields the model can speak from. See the "Design tools for the
61
109
  model" section of `references/authoring-workflow.md`.
62
110
 
111
+ ## Set the secret for local runs
112
+
113
+ `noodle secrets set NAME --from-env NAME` **without a scope** writes to your global target (or errors) — which a local `noodle dev` never reads. Local `dev` resolves secrets under `org=local`, `app=<project-dir-slug>`, `env=dev` (the `…/o/local/<app>/dev/mcp` URL it prints). Set the secret at a matching local scope:
114
+
115
+ ```sh
116
+ # Simplest — org scope is visible to every local app. Pin --runtime local so a cloud login
117
+ # (a non-local default runtime) does not send it to the hosted control plane:
118
+ noodle secrets set SOME_API_KEY --runtime local --scope org --org local --from-env SOME_API_KEY
119
+ # Or the exact env scope, using the app slug from the printed dev URL:
120
+ noodle secrets set SOME_API_KEY --runtime local --scope env --org local --app <app-slug> --env dev --from-env SOME_API_KEY
121
+ ```
122
+
123
+ Local secrets live in `./.env.noodle` (never commit it). **Symptom to recognize:** a required `secret(...)` that can’t resolve fails compile *closed*, so nothing is served. `noodle tools call` / `noodle test` / `noodle dev` name this directly as `connector_secret_unresolved` with the exact scoped-secret fix; an external MCP client (Inspector/mcpjam) hitting the loopback still sees an opaque `-32600 "not found"`. Either way, fix the secret’s scope, not the connector.
124
+
63
125
  ## Prove real output
64
126
 
65
127
  `noodle validate` / `noodle test` prove a connector tool *compiles and registers* — not that its
@@ -9,7 +9,7 @@ Paths are relative to this skill directory. Assets (images/fonts) are omitted fr
9
9
  | Example | Use when | Read |
10
10
  | :-- | :-- | :-- |
11
11
  | `hello` | Minimal TypeScript quickstart — a single tool, no connectors/widgets. | `examples/hello/src/server.ts` |
12
- | `weather` | HTTP connectors, multi-step flows, and the sandboxed compute connector. | `examples/weather/src/server.ts` |
12
+ | `weather` | HTTP connectors, multi-step flows, a list-returning connector op (whole-array bind + compute narrowing), and the sandboxed compute connector. | `examples/weather/src/server.ts` |
13
13
  | `food-ordering` | Consumer ordering MCP App widgets, app-only helpers, cart state, assets, branding, and handoff. | `examples/food-ordering/src/server.ts` |
14
14
  | `acme-discovery` | Top-of-funnel discovery→handoff: a discovery carousel, a `create_handoff` deep link, and a design-first UX spec + wireframe. | `examples/acme-discovery/src/server.ts` + `design/` |
15
15
  | `acme-tasks` | A two-way productivity app designed around its top-3 prioritized flows (capture/prioritize/complete), with a design-first flow spec + wireframe. | `examples/acme-tasks/src/server.ts` + `design/` |
@@ -26,5 +26,7 @@ For protocol/conformance checks, the headless harness is `@mcpjam/cli`, not a `n
26
26
  | Hosted endpoint returns 401 to probes | Expected: hosted servers challenge unauthenticated calls with OAuth metadata | Sign in from the host when prompted; widen who may call with `noodle access set` if testers are outside the org |
27
27
  | Tools error only after deploy | Runtime/config differences surface hosted (secrets, connector reachability) | Run `noodle smoke`, then `noodle metrics --agent-output` and `noodle events --tool <name> --status tool_error --json`; check `noodle secrets list` scope |
28
28
  | A connector tool validates and lists, but returns empty or `undefined` fields | The `response` mapping references a path the API does not return — usually the wrong root (a `.body` segment, when the parsed body is bound directly to `${response}`) or the wrong shape | Run `noodle tools call <name> --args <json>` with the secret set and compare the mapped result to the API’s real JSON; map from `${response.<path>}` (the body is `${response}`, there is no `.body`) and use bracket array indices (`${response.items[0].id}`) |
29
+ | A connector should return a list but returns one item, `undefined`, or the whole raw objects | A `${response.arr[0]…}` mapping picks ONE element; a response mapping cannot reshape array items and a tool’s Zod output does not strip them at runtime | Bind the whole array with `${response.<arr>}`, then narrow each element in a compute connector (`references/connect-an-api.md` → “Return a list”) |
30
+ | `noodle dev` boots but the loopback returns `-32600 "not found"` (or 404) for a valid server | A required `secret(...)` is unresolved — a missing secret fails compile *closed* at boot so nothing is served; the local secret was set at a scope `noodle dev` does not read | Set the secret at the scope your local `noodle dev` resolves — `noodle secrets set NAME --runtime local --scope org --org local --from-env NAME`; the clear `missing_secret` line is in the `noodle dev` boot log, not the HTTP response (`references/connect-an-api.md` → “Set the secret for local runs”) |
29
31
  | Need to invoke a tool from the terminal | Local tools run in-process; the `noodle` CLI is not a general MCP client for **deployed** URLs (there is no `call <url>` verb) | Locally, `noodle tools call <name> --args <json>` (also `noodle resources read` / `noodle prompts get`) runs the tool against the in-process runtime — with the secret set it executes the connector against the real API, so use it to prove mapped output. For a **deployed** URL use MCP Inspector or `npx @mcpjam/cli@latest tools call --url <url> ...` |
30
32
  | One customer/session reports a bad answer or protocol error | The failure may be a model/tool error, host protocol error, or connector/runtime error | Run `noodle metrics --agent-output`, then `noodle events --tool <name> --status tool_error --json`; copy the `sessionId` into `noodle events --session <id> --json`, then match timestamps with `noodle logs` |
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  name: noodle-seed
3
3
  description: Use when building, validating, testing, deploying, or operating a local or hosted Noodle Seed MCP server or app authored in TypeScript with the noodle CLI.
4
- version: 0.15.0
5
- hash: e623fd6ca7caad0f
4
+ version: 0.16.0
5
+ hash: 39c6a606c728d164
6
6
  ---
7
7
 
8
8
  # Noodle Seed
@@ -15,6 +15,8 @@ Use this skill for local Noodle Seed project work in Codex.
15
15
 
16
16
  This CLI is agent-native: the cold-agent-path commands speak the `--json` envelope (hosted admin/ops commands are still being normalized). Drive the loop by parsing machine state, not human prose. The full envelope, exit codes, and output modes are in `references/agent-contract.md`.
17
17
 
18
+ **Discover the skill first.** Before authoring anything, read this whole `SKILL.md` and scan the `## References` index below (including `references/examples.md`) so you build from the shipped patterns — connectors that return live lists, secret scoping, widgets, testing — instead of rediscovering them. Open the references your task touches in full.
19
+
18
20
  Before authoring, design the experience — the funnel/handoff boundary, tools, widgets, display modes, and grounding — see `references/experience-design.md`. Then run the loop:
19
21
 
20
22
  1. **Discover** — `noodle commands --json`: every command, subcommand, flag, and exit code (don't read source).
@@ -22,7 +24,7 @@ Before authoring, design the experience — the funnel/handoff boundary, tools,
22
24
  3. **Validate** — `noodle validate --json`; on failure `{ok:false,error:{code,message,fix,next,errors:[{code,path,message}]}}` — the per-field detail is in `error.errors[]`.
23
25
  4. **Repair** — fix each `error.errors[]` entry at its `path`, then re-run `noodle validate --json`; `noodle validate --fix-prompt` emits ready-to-apply repair prose. Never freeform re-edit (see `references/compile-errors.md`).
24
26
  5. **Smoke** — `noodle test --json`: local compile plus a loopback MCP smoke.
25
- 6. **Prove real output** — `validate`/`test` prove a connector tool *compiles and registers*, not that its response mapping returns data. Set the secret locally (`noodle secrets set <NAME> --from-env <ENV>`), then run a live read — `noodle tools call <read_tool> --args '{...}'` executes the connector against the real API in-process — and confirm the mapped fields are populated, not `undefined`, before trusting it. Only run a live write if it is safe/approved.
27
+ 6. **Prove real output** — `validate`/`test` prove a connector tool *compiles and registers*, not that its response mapping returns data. Set the secret at the scope your local `noodle dev` resolves (`noodle secrets set <NAME> --runtime local --scope org --org local --from-env <ENV>`; a secret set at the wrong scope leaves the loopback returning `-32600 "not found"` — see `references/connect-an-api.md`), then run a live read — `noodle tools call <read_tool> --args '{...}'` executes the connector against the real API in-process — and confirm the mapped fields are populated, not `undefined`, before trusting it. Only run a live write if it is safe/approved.
26
28
  7. **Apps/widgets** — `noodle check --json` (add `--target chatgpt|claude`), then `noodle devtools` (see `references/widgets-and-apps.md`).
27
29
  8. **Deploy** — `noodle deploy`; auth fails clean with `error.next` = `noodle login` (see `references/deploy-and-ops.md`).
28
30
  9. **Wire into a host** — `noodle connect <codex|claude-code|chatgpt>` (prove it in a real host per `references/test-in-hosts.md`; debug symptoms with `references/troubleshooting.md`).
@@ -30,7 +32,7 @@ Before authoring, design the experience — the funnel/handoff boundary, tools,
30
32
 
31
33
  ## References
32
34
 
33
- Load these on demand:
35
+ Scan all of these during discovery; open in full the ones your task touches:
34
36
 
35
37
  - `references/agent-contract.md` — the `--json` envelope, exit codes, and the three output modes.
36
38
  - `references/sdk-surface.md` — what to import from `@noodleseed/one` and which builder to use.
@@ -1,15 +1,22 @@
1
1
  # Weather Briefing
2
2
 
3
- A single declarative tool that shows the runtime's breadth working together, with **no auth and no API
3
+ Two declarative tools that show the runtime's breadth working together, with **no auth and no API
4
4
  keys**. The `weather_briefing` tool takes a city name and runs a **three-step flow**:
5
5
 
6
- Capability slots: HTTP connector authoring, ordered fulfilment flows, query/response mapping, and sandboxed
7
- compute.
6
+ Capability slots: HTTP connector authoring, ordered fulfilment flows, query/response mapping,
7
+ **list-returning connector output** (a connector that returns a live, variable-length array), and
8
+ sandboxed compute.
8
9
 
9
10
  1. **`geo.search`** → geocode the city to coordinates (Open-Meteo Geocoding API)
10
11
  2. **`forecast.current`** → fetch current weather for those coordinates (Open-Meteo Forecast API)
11
12
  3. **`brief.summarize`** → derive a human-readable briefing in a **WASM/QuickJS compute sandbox**
12
13
 
14
+ The second tool, `search_places`, shows a connector returning a **live, variable-length list**: it binds
15
+ the whole Open-Meteo geocoding `results` array with `${response.results}`, then narrows each match to
16
+ `{ id, label }` in a compute connector — the "search → a list of options the model can pick from"
17
+ pattern. Narrowing lives in compute because a `${...}` response mapping cannot iterate an array and a
18
+ tool's Zod output does not strip fields at runtime.
19
+
13
20
  It exercises, in one TypeScript-authored app:
14
21
 
15
22
  - **Server-level branding** with semantic tokens carried through the runtime artifact for any generated
@@ -17,8 +24,12 @@ It exercises, in one TypeScript-authored app:
17
24
  - **Ordered flow execution** with outputs threaded between steps (`${steps.geo.latitude}` → next step).
18
25
  - **Two HTTP connectors on two different hosts**, each with its own egress allowlist.
19
26
  - **Query parameters** (`query: [...]`) and a constant query baked into the path (`?current_weather=true`).
20
- - **Deep response mapping** with the `${...}` language (`${response.results[0].latitude}`,
21
- `${response.current_weather.temperature}`).
27
+ - **Deep response mapping** with the `${...}` language — single-element indexing
28
+ (`${response.results[0].latitude}`, `${response.current_weather.temperature}`) **and** whole-array
29
+ binding (`${response.results}` returns the entire list verbatim).
30
+ - **A list-returning connector + compute narrowing** — `geo.search_list` binds the whole `results`
31
+ array; `places.narrow` reduces each element to `{ id, label }` and normalizes the no-results case
32
+ to `[]`.
22
33
  - **Sandboxed compute** (no network/fs/env/clock) turning raw numbers into conditions + advice.
23
34
  - **Typed input/output schemas** emitted as JSON Schema 2020-12.
24
35
 
@@ -52,3 +63,23 @@ Example result (live data, abbreviated):
52
63
  ```
53
64
 
54
65
  Try other cities (`Reykjavik`, `Singapore`, `Denver`) to see the conditions and advice change.
66
+
67
+ Call `search_places` to see the **list-returning** tool — one query, many matches:
68
+
69
+ ```bash
70
+ curl -s "$URL" \
71
+ -H 'content-type: application/json' \
72
+ -H 'accept: application/json, text/event-stream' \
73
+ -H 'mcp-protocol-version: 2025-11-25' \
74
+ -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"search_places","arguments":{"query":"Springfield"}}}'
75
+ ```
76
+
77
+ ```json
78
+ {
79
+ "places": [
80
+ { "id": "4951788", "label": "Springfield, Massachusetts, United States" },
81
+ { "id": "4250542", "label": "Springfield, Illinois, United States" },
82
+ { "id": "4508722", "label": "Springfield, Ohio, United States" }
83
+ ]
84
+ }
85
+ ```
@@ -33,6 +33,28 @@ const geocoding = connector('open_meteo_geocoding')
33
33
  country: '${response.results[0].country}',
34
34
  },
35
35
  },
36
+ // A LIST-returning read. `${response.results}` binds the WHOLE array verbatim — a
37
+ // variable-length list of place objects — with no pagination (Open-Meteo returns every match in
38
+ // one page). Contrast the `search` op above, which indexes a single element (`results[0]`). To
39
+ // reduce each element to a few fields, narrow it in the `geo_places` compute connector below: a
40
+ // response mapping cannot iterate an array, and a tool's Zod output does not strip fields at
41
+ // runtime.
42
+ search_list: {
43
+ type: 'read',
44
+ method: 'GET',
45
+ path: '/v1/search',
46
+ query: ['name', 'count'],
47
+ input: {
48
+ name: { type: 'string', required: true },
49
+ count: { type: 'number' },
50
+ },
51
+ output: {
52
+ results: { type: 'array' },
53
+ },
54
+ response: {
55
+ results: '${response.results}',
56
+ },
57
+ },
36
58
  },
37
59
  });
38
60
 
@@ -132,12 +154,44 @@ const brief = connector('weather_brief')
132
154
  },
133
155
  });
134
156
 
157
+ // Narrowing a live list to `{ id, label }` summaries is the ONE reshape a response mapping cannot do
158
+ // (the `${...}` language has no per-item iteration) and a tool's Zod output does not enforce at runtime
159
+ // — so it happens here, in a sandboxed compute connector (a connector is HTTP or compute, not both).
160
+ // This also normalizes the no-results case (Open-Meteo omits `results` when nothing matches) to `[]`.
161
+ const placeNarrow = connector('geo_places')
162
+ .version('1.0.0')
163
+ .compute('narrow', {
164
+ type: 'read',
165
+ input: {
166
+ results: { type: 'unknown' },
167
+ },
168
+ output: {
169
+ places: { type: 'array', required: true },
170
+ },
171
+ // Self-contained: no imports, no closure over outer variables, synchronous.
172
+ run: (input) => {
173
+ const raw = input.results;
174
+ const list = Array.isArray(raw) ? raw : [];
175
+ const places = list.map((entry) => {
176
+ const parts = [entry.name, entry.admin1, entry.country].filter(
177
+ (part) => typeof part === 'string' && part.length > 0,
178
+ );
179
+ const id =
180
+ entry.id !== undefined && entry.id !== null
181
+ ? String(entry.id)
182
+ : `${entry.latitude},${entry.longitude}`;
183
+ return { id, label: parts.join(', ') };
184
+ });
185
+ return { places };
186
+ },
187
+ });
188
+
135
189
  export default server(
136
190
  'weather_briefing',
137
191
  {
138
192
  title: 'Weather Briefing',
139
193
  version: '1.0.0',
140
- use: { geo: geocoding, forecast, brief },
194
+ use: { geo: geocoding, forecast, brief, places: placeNarrow },
141
195
  branding: {
142
196
  name: 'Weather Briefing',
143
197
  accent: '#0284C7',
@@ -186,5 +240,22 @@ export default server(
186
240
  };
187
241
  },
188
242
  }),
243
+ // A connector that returns a live, variable-length LIST: search a place name, get back the
244
+ // matching locations as `{ id, label }` options the model can resolve against. The HTTP op binds
245
+ // the whole array; the compute connector narrows each element to the two fields the model speaks
246
+ // from. Append new tools AFTER existing ones so `tools[0]` stays stable for host harnesses.
247
+ tool('search_places', {
248
+ description:
249
+ 'Search a place name and return the matching locations as a list of { id, label } options.',
250
+ input: z.object({ query: z.string() }),
251
+ output: z.object({
252
+ places: z.array(z.object({ id: z.string(), label: z.string() })),
253
+ }),
254
+ fulfil: ({ input, connectors }) => {
255
+ const found = connectors.geo.search_list({ name: input.query });
256
+ const narrowed = connectors.places.narrow({ results: found.results });
257
+ return { places: narrowed.places };
258
+ },
259
+ }),
189
260
  ],
190
261
  );
@@ -5,4 +5,25 @@ describe('weather example', () => {
5
5
  it('exports a Noodle server definition', () => {
6
6
  expect(typeof app.toManifest).toBe('function');
7
7
  });
8
+
9
+ it('adds a list-returning search_places tool without disturbing tool order', async () => {
10
+ const manifest = (await app.toManifest()) as {
11
+ tools: ReadonlyArray<{ name: string }>;
12
+ connectors?: Record<string, { id: string; version: string }>;
13
+ };
14
+ const toolNames = manifest.tools.map((t) => t.name);
15
+ // The original briefing tool stays first — host harnesses (the online e2e) read `tools[0]`,
16
+ // so new tools are appended, never prepended.
17
+ expect(toolNames[0]).toBe('weather_briefing');
18
+ expect(toolNames).toContain('search_places');
19
+ expect(toolNames.indexOf('search_places')).toBeGreaterThan(
20
+ toolNames.indexOf('weather_briefing'),
21
+ );
22
+ // The list is produced by a whole-array-bind HTTP op (`search_list`) narrowed to {id,label}
23
+ // through a separate compute connector (`geo_places`).
24
+ expect(manifest.connectors?.places).toEqual({ id: 'geo_places', version: '1.0.0' });
25
+ const wire = JSON.stringify(manifest);
26
+ expect(wire).toContain('search_list');
27
+ expect(wire).toContain('narrow');
28
+ });
8
29
  });
@@ -8,7 +8,10 @@ drift. Probe the live API, learn the real shape, then encode it as a `connector`
8
8
  - Secure the key first
9
9
  - Probe the live API
10
10
  - Model the connector from the observed shape
11
+ - Return a list
12
+ - Create, update, delete
11
13
  - Design intent tools
14
+ - Set the secret for local runs
12
15
  - Prove real output
13
16
  - Then build the app
14
17
 
@@ -19,7 +22,7 @@ managed secret and reference it only as `secret(...)`:
19
22
 
20
23
  ```sh
21
24
  export SOME_API_KEY=… # the user sets this; it never appears in a file or prompt
22
- noodle secrets set SOME_API_KEY --from-env SOME_API_KEY
25
+ noodle secrets set SOME_API_KEY --runtime local --scope org --org local --from-env SOME_API_KEY # local-run scope — see "Set the secret for local runs"
23
26
  ```
24
27
 
25
28
  In `server.ts` the key is only ever `secret("SOME_API_KEY")` — keep the raw value out of code, tests,
@@ -53,6 +56,51 @@ Encode the API as an HTTP connector, mapping only the fields you actually saw in
53
56
  The full connector shape, every `auth.kind`, and compute connectors are in
54
57
  `references/authoring-workflow.md`.
55
58
 
59
+ ## Return a list
60
+
61
+ Most real tools return a variable-length list (search results, a user’s tasks). Bind the **whole array** — a single `${response.path}` returns the referenced value verbatim, arrays included:
62
+
63
+ ```ts
64
+ // The API returns { results: [ { id, name, country, … }, … ] }
65
+ output: { places: { type: 'array' } },
66
+ response: { places: '${response.results}' },
67
+ ```
68
+
69
+ Three things that are easy to get subtly wrong:
70
+
71
+ - **A response mapping cannot iterate.** There is no per-item / `map` / `item` construct, so you cannot reshape `[{…30 fields}]` into `[{ id, label }]` inside a `response:` block — bind the whole array.
72
+ - **A tool's Zod `output` does not strip at runtime.** It only advertises the JSON Schema; the runtime returns your `fulfil` output verbatim, so `z.array(z.object({ id, label }))` will NOT drop extra element fields.
73
+ - **So narrow in a compute connector.** To reshape each element, synthesize a `label`, or normalize a missing array to `[]`, pass the whole array to a `.compute(...)` op whose `run` maps it (a connector is HTTP **or** compute, not both — use a second connector). To only *drop* known fields without reshaping, `projection: { hiddenFields: [...] }` deletes them from each element. Worked example: `examples/weather` — `search_list` binds the array, then `geo_places.narrow` reshapes to `{ id, label }` and normalizes no-results to `[]`; `examples/sharepoint-lists` shows the same pattern against a real API.
74
+
75
+ For a **paginated** API, collect across pages with a `pagination` config; the collected list is then `${response.items}`:
76
+
77
+ ```ts
78
+ pagination: {
79
+ kind: 'cursor', // or 'pageNumber'
80
+ items: '${response.results}', // the array on ONE page
81
+ nextCursor: '${response.next_cursor}', // 'pageNumber' uses hasMore + pageParam instead
82
+ cursorParam: 'cursor',
83
+ maxPages: 5, maxItems: 100,
84
+ },
85
+ // items / nextCursor / hasMore run over ONE raw page; your response mapping runs over the
86
+ // collected aggregate, so the full list is:
87
+ response: { tasks: '${response.items}' },
88
+ ```
89
+
90
+ ## Create, update, delete
91
+
92
+ Pair the read/list with the mutations your intent tools need:
93
+ - **Create / update** — `method: 'POST'` / `'PATCH'`; the request body is authored as `request: { field: '${input.x}' }` — the `request` object **is** the JSON body (do not nest it under `body`), and URL query params are the operation-level `query: [...]` array.
94
+ - **Delete / close** — many endpoints return `204 No Content`. Set `responseType: 'empty'`, which enforces the status and binds `{}` (there is no body to map).
95
+
96
+ ```ts
97
+ close_task: {
98
+ type: 'action', method: 'POST', path: '/tasks/{id}/close',
99
+ input: { id: { type: 'string', required: true } },
100
+ responseType: 'empty',
101
+ },
102
+ ```
103
+
56
104
  ## Design intent tools
57
105
 
58
106
  Shape tools around what the user says, not 1:1 around endpoints. Pair an id-taking action with a
@@ -60,6 +108,20 @@ find/search operation that returns `{ id, label }` summaries so the model resolv
60
108
  and map each response to a few labelled fields the model can speak from. See the "Design tools for the
61
109
  model" section of `references/authoring-workflow.md`.
62
110
 
111
+ ## Set the secret for local runs
112
+
113
+ `noodle secrets set NAME --from-env NAME` **without a scope** writes to your global target (or errors) — which a local `noodle dev` never reads. Local `dev` resolves secrets under `org=local`, `app=<project-dir-slug>`, `env=dev` (the `…/o/local/<app>/dev/mcp` URL it prints). Set the secret at a matching local scope:
114
+
115
+ ```sh
116
+ # Simplest — org scope is visible to every local app. Pin --runtime local so a cloud login
117
+ # (a non-local default runtime) does not send it to the hosted control plane:
118
+ noodle secrets set SOME_API_KEY --runtime local --scope org --org local --from-env SOME_API_KEY
119
+ # Or the exact env scope, using the app slug from the printed dev URL:
120
+ noodle secrets set SOME_API_KEY --runtime local --scope env --org local --app <app-slug> --env dev --from-env SOME_API_KEY
121
+ ```
122
+
123
+ Local secrets live in `./.env.noodle` (never commit it). **Symptom to recognize:** a required `secret(...)` that can’t resolve fails compile *closed*, so nothing is served. `noodle tools call` / `noodle test` / `noodle dev` name this directly as `connector_secret_unresolved` with the exact scoped-secret fix; an external MCP client (Inspector/mcpjam) hitting the loopback still sees an opaque `-32600 "not found"`. Either way, fix the secret’s scope, not the connector.
124
+
63
125
  ## Prove real output
64
126
 
65
127
  `noodle validate` / `noodle test` prove a connector tool *compiles and registers* — not that its
@@ -9,7 +9,7 @@ Paths are relative to this skill directory. Assets (images/fonts) are omitted fr
9
9
  | Example | Use when | Read |
10
10
  | :-- | :-- | :-- |
11
11
  | `hello` | Minimal TypeScript quickstart — a single tool, no connectors/widgets. | `examples/hello/src/server.ts` |
12
- | `weather` | HTTP connectors, multi-step flows, and the sandboxed compute connector. | `examples/weather/src/server.ts` |
12
+ | `weather` | HTTP connectors, multi-step flows, a list-returning connector op (whole-array bind + compute narrowing), and the sandboxed compute connector. | `examples/weather/src/server.ts` |
13
13
  | `food-ordering` | Consumer ordering MCP App widgets, app-only helpers, cart state, assets, branding, and handoff. | `examples/food-ordering/src/server.ts` |
14
14
  | `acme-discovery` | Top-of-funnel discovery→handoff: a discovery carousel, a `create_handoff` deep link, and a design-first UX spec + wireframe. | `examples/acme-discovery/src/server.ts` + `design/` |
15
15
  | `acme-tasks` | A two-way productivity app designed around its top-3 prioritized flows (capture/prioritize/complete), with a design-first flow spec + wireframe. | `examples/acme-tasks/src/server.ts` + `design/` |
@@ -26,5 +26,7 @@ For protocol/conformance checks, the headless harness is `@mcpjam/cli`, not a `n
26
26
  | Hosted endpoint returns 401 to probes | Expected: hosted servers challenge unauthenticated calls with OAuth metadata | Sign in from the host when prompted; widen who may call with `noodle access set` if testers are outside the org |
27
27
  | Tools error only after deploy | Runtime/config differences surface hosted (secrets, connector reachability) | Run `noodle smoke`, then `noodle metrics --agent-output` and `noodle events --tool <name> --status tool_error --json`; check `noodle secrets list` scope |
28
28
  | A connector tool validates and lists, but returns empty or `undefined` fields | The `response` mapping references a path the API does not return — usually the wrong root (a `.body` segment, when the parsed body is bound directly to `${response}`) or the wrong shape | Run `noodle tools call <name> --args <json>` with the secret set and compare the mapped result to the API’s real JSON; map from `${response.<path>}` (the body is `${response}`, there is no `.body`) and use bracket array indices (`${response.items[0].id}`) |
29
+ | A connector should return a list but returns one item, `undefined`, or the whole raw objects | A `${response.arr[0]…}` mapping picks ONE element; a response mapping cannot reshape array items and a tool’s Zod output does not strip them at runtime | Bind the whole array with `${response.<arr>}`, then narrow each element in a compute connector (`references/connect-an-api.md` → “Return a list”) |
30
+ | `noodle dev` boots but the loopback returns `-32600 "not found"` (or 404) for a valid server | A required `secret(...)` is unresolved — a missing secret fails compile *closed* at boot so nothing is served; the local secret was set at a scope `noodle dev` does not read | Set the secret at the scope your local `noodle dev` resolves — `noodle secrets set NAME --runtime local --scope org --org local --from-env NAME`; the clear `missing_secret` line is in the `noodle dev` boot log, not the HTTP response (`references/connect-an-api.md` → “Set the secret for local runs”) |
29
31
  | Need to invoke a tool from the terminal | Local tools run in-process; the `noodle` CLI is not a general MCP client for **deployed** URLs (there is no `call <url>` verb) | Locally, `noodle tools call <name> --args <json>` (also `noodle resources read` / `noodle prompts get`) runs the tool against the in-process runtime — with the secret set it executes the connector against the real API, so use it to prove mapped output. For a **deployed** URL use MCP Inspector or `npx @mcpjam/cli@latest tools call --url <url> ...` |
30
32
  | One customer/session reports a bad answer or protocol error | The failure may be a model/tool error, host protocol error, or connector/runtime error | Run `noodle metrics --agent-output`, then `noodle events --tool <name> --status tool_error --json`; copy the `sessionId` into `noodle events --session <id> --json`, then match timestamps with `noodle logs` |