@emseepea/create-api-backed-server 0.0.9 → 0.0.10

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.
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "private": true,
27
27
  "dependencies": {
28
- "@emseepea/server": "0.3.2",
28
+ "@emseepea/server": "0.3.3",
29
29
  "zod": "4.4.3"
30
30
  }
31
31
  }
@@ -57,20 +57,6 @@ export default (({ client }) => defineMappedTool({
57
57
  source: "iNaturalist" as const,
58
58
  source_url: "https://www.inaturalist.org" as const,
59
59
  };
60
- const lines = data.results.map((record) => [
61
- record.preferred_common_name ?? "Common name not provided",
62
- record.name,
63
- `rank: ${record.rank}`,
64
- `recorded observations: ${record.observations_count}`,
65
- ].join("; "));
66
- return {
67
- text: [
68
- `iNaturalist returned ${data.results.length} of ${data.total_results} matching taxa for “${data.query}”.`,
69
- "observations_count is the number of recorded observations, not a population estimate.",
70
- ...lines,
71
- "Source: https://www.inaturalist.org",
72
- ].join("\n"),
73
- data,
74
- };
60
+ return { data };
75
61
  },
76
62
  })) satisfies CapabilityModuleFactory<BackendExampleContext>;
@@ -57,7 +57,7 @@ test("the API-backed example checks and passes through selected iNaturalist valu
57
57
  source: "iNaturalist",
58
58
  source_url: "https://www.inaturalist.org",
59
59
  });
60
- assert.match(result.content[0].text, /not a population estimate/);
60
+ assert.equal(result.content[0].text, JSON.stringify(result.structuredContent));
61
61
  assert.equal(requests[0].pathname, "/v1/taxa");
62
62
  assert.deepEqual(requests[0].searchParams, {
63
63
  q: "pea",
@@ -91,6 +91,7 @@ test("the API-backed example checks and passes through selected iNaturalist valu
91
91
  observations_count: 0,
92
92
  });
93
93
  assert.equal("private_note" in newProviderValue.structuredContent.results[0], false);
94
+ assert.equal(newProviderValue.content[0].text, JSON.stringify(newProviderValue.structuredContent));
94
95
 
95
96
  response = { total_results: 1, results: [{ id: "bad provider row" }] };
96
97
  const invalidProviderData = await client.callTool({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emseepea/create-api-backed-server",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "description": "Create an Em See Pea server backed by a public web API.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -18,7 +18,7 @@
18
18
  "prepack": "npm run build:initializer"
19
19
  },
20
20
  "devDependencies": {
21
- "@emseepea/server": "0.3.2",
21
+ "@emseepea/server": "0.3.3",
22
22
  "zod": "4.4.3",
23
23
  "@emseepea/testing": "0.3.0",
24
24
  "@modelcontextprotocol/client": "2.0.0",