@oneshot-agent/mcp-server 0.34.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.
- package/README.md +5 -5
- package/dist/index.js +1 -1
- package/dist/tools/annotations.js +15 -3
- package/dist/tools/browser.js +1 -1
- package/dist/tools/compute.d.ts +4 -3
- package/dist/tools/compute.js +9 -5
- package/dist/tools/domains.js +1 -1
- package/dist/tools/email.js +2 -2
- package/dist/tools/gov.d.ts +2 -2
- package/dist/tools/gov.js +4 -4
- package/dist/tools/index.js +13 -8
- package/dist/tools/linkedin.js +6 -4
- package/dist/tools/local.d.ts +4 -4
- package/dist/tools/local.js +8 -8
- package/dist/tools/lookup-manifest.generated.d.ts +34 -0
- package/dist/tools/lookup-manifest.generated.js +1339 -0
- package/dist/tools/lookup.d.ts +29 -0
- package/dist/tools/lookup.js +44 -0
- package/dist/tools/people.js +3 -3
- package/package.json +2 -2
|
@@ -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)]));
|
package/dist/tools/people.js
CHANGED
|
@@ -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
|
|
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",
|
|
@@ -37,12 +37,12 @@ export const peopleSearchTool = {
|
|
|
37
37
|
seniority: {
|
|
38
38
|
type: "array",
|
|
39
39
|
items: { type: "string" },
|
|
40
|
-
description: "Seniority levels
|
|
40
|
+
description: "Seniority levels: owner, founder, c_suite, partner, vp, head, director, manager, senior, entry, intern. Common variants ('Vice President', 'C-Level', 'executive') are accepted. A value that matches no level fails the search.",
|
|
41
41
|
},
|
|
42
42
|
industry: {
|
|
43
43
|
type: "array",
|
|
44
44
|
items: { type: "string" },
|
|
45
|
-
description: "Industries to filter by",
|
|
45
|
+
description: "Industries to filter by, as free text (e.g., ['fintech', 'software'])",
|
|
46
46
|
},
|
|
47
47
|
company_size: {
|
|
48
48
|
type: "string",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oneshot-agent/mcp-server",
|
|
3
|
-
"version": "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.
|
|
29
|
+
"@oneshot-agent/sdk": "^0.51.0",
|
|
30
30
|
"zod": "3.25.76"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|