@oneshot-agent/mcp-server 0.35.0 → 0.36.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.
@@ -0,0 +1,29 @@
1
+ import type { Tool } from "@modelcontextprotocol/sdk/types.js";
2
+ import type { OneShot } from "@oneshot-agent/sdk";
3
+ import { type RouteManifestEntry } from "./lookup-manifest.generated.js";
4
+ /**
5
+ * The lookup tools (#1445). One MCP tool per manifest entry, named
6
+ * `oneshot_<name>`; the manifest is generated from the API's lookup registry
7
+ * (`bun scripts/generate-lookup-tools.ts`), so a new lookup tool needs no edit here.
8
+ *
9
+ * The declared routes (#1580) are the second half: every declared route that
10
+ * states an agent tool and has no hand-written MCP tool is in `ROUTE_MANIFEST`
11
+ * and is built here the same way, through the SDK's generic `route()` call. A
12
+ * hand-written tool stays where it goes through a typed SDK method; the
13
+ * declaration names it (`agentTool.mcp`).
14
+ */
15
+ export declare const lookupToolDefinitions: Tool[];
16
+ type Handler = (agent: OneShot, args: Record<string, unknown>) => Promise<unknown>;
17
+ export declare const lookupHandlers: Record<string, Handler>;
18
+ export declare const routeToolDefinitions: Tool[];
19
+ /**
20
+ * Splits a tool's arguments for the SDK's `route()`: the `{param}` inputs of the path go to `params`, and the rest
21
+ * to the query (a GET or DELETE) or the body (any other method). An object field is passed through unchanged.
22
+ */
23
+ export declare function routeRequest(entry: Pick<RouteManifestEntry, "name" | "method" | "path">, args: Record<string, unknown>): {
24
+ params: Record<string, string | number>;
25
+ query?: Record<string, unknown>;
26
+ body?: Record<string, unknown>;
27
+ };
28
+ export declare const routeHandlers: Record<string, Handler>;
29
+ export {};
@@ -0,0 +1,44 @@
1
+ import { LOOKUP_MANIFEST, ROUTE_MANIFEST } from "./lookup-manifest.generated.js";
2
+ /**
3
+ * The lookup tools (#1445). One MCP tool per manifest entry, named
4
+ * `oneshot_<name>`; the manifest is generated from the API's lookup registry
5
+ * (`bun scripts/generate-lookup-tools.ts`), so a new lookup tool needs no edit here.
6
+ *
7
+ * The declared routes (#1580) are the second half: every declared route that
8
+ * states an agent tool and has no hand-written MCP tool is in `ROUTE_MANIFEST`
9
+ * and is built here the same way, through the SDK's generic `route()` call. A
10
+ * hand-written tool stays where it goes through a typed SDK method; the
11
+ * declaration names it (`agentTool.mcp`).
12
+ */
13
+ export const lookupToolDefinitions = LOOKUP_MANIFEST.map((entry) => ({
14
+ name: `oneshot_${entry.name}`,
15
+ description: entry.description,
16
+ inputSchema: entry.inputSchema,
17
+ }));
18
+ export const lookupHandlers = Object.fromEntries(LOOKUP_MANIFEST.map((entry) => [
19
+ `oneshot_${entry.name}`,
20
+ (agent, args) => agent.tool(entry.path, args),
21
+ ]));
22
+ export const routeToolDefinitions = ROUTE_MANIFEST.map((entry) => ({
23
+ name: `oneshot_${entry.name}`,
24
+ description: entry.description,
25
+ inputSchema: entry.inputSchema,
26
+ }));
27
+ /**
28
+ * Splits a tool's arguments for the SDK's `route()`: the `{param}` inputs of the path go to `params`, and the rest
29
+ * to the query (a GET or DELETE) or the body (any other method). An object field is passed through unchanged.
30
+ */
31
+ export function routeRequest(entry, args) {
32
+ const rest = { ...args };
33
+ const params = {};
34
+ for (const [, param] of entry.path.matchAll(/\{([a-z0-9_]+)\}/g)) {
35
+ const value = rest[param];
36
+ delete rest[param];
37
+ if ((typeof value !== "string" && typeof value !== "number") || String(value) === "")
38
+ throw new Error(`oneshot_${entry.name}: ${param} is required`);
39
+ params[param] = value;
40
+ }
41
+ return entry.method === "GET" || entry.method === "DELETE" ? { params, query: rest } : { params, body: rest };
42
+ }
43
+ const routeHandler = (entry) => (agent, args) => agent.route(entry.method, entry.path, { ...routeRequest(entry, args), paid: entry.paid });
44
+ export const routeHandlers = Object.fromEntries(ROUTE_MANIFEST.map((entry) => [`oneshot_${entry.name}`, routeHandler(entry)]));
@@ -22,7 +22,7 @@ export const peopleSearchTool = {
22
22
  company_domains: {
23
23
  type: "array",
24
24
  items: { type: "string" },
25
- description: "Company domains to filter by (e.g., ['stripe.com', 'nike.com']). Preferred over company names for providers that require domains.",
25
+ description: "Company domains to filter by (e.g., ['stripe.com', 'nike.com']). Preferred over company names; matches more reliably.",
26
26
  },
27
27
  location: {
28
28
  type: "array",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneshot-agent/mcp-server",
3
- "version": "0.35.0",
3
+ "version": "0.36.0",
4
4
  "description": "MCP server for OneShot - 81 tools for AI agents",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -26,7 +26,7 @@
26
26
  "dependencies": {
27
27
  "@coinbase/cdp-sdk": "1.45.0",
28
28
  "@modelcontextprotocol/sdk": "1.27.1",
29
- "@oneshot-agent/sdk": "^0.49.0",
29
+ "@oneshot-agent/sdk": "^0.51.0",
30
30
  "zod": "3.25.76"
31
31
  },
32
32
  "devDependencies": {