@oneshot-agent/mcp-server 0.17.3 → 0.20.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 +32 -3
- package/dist/index.js +17 -3
- package/dist/tools/analytics.d.ts +2 -2
- package/dist/tools/browser.d.ts +2 -2
- package/dist/tools/build.d.ts +2 -2
- package/dist/tools/commerce.d.ts +2 -2
- package/dist/tools/company.d.ts +2 -2
- package/dist/tools/compute.d.ts +2 -2
- package/dist/tools/domains.d.ts +2 -2
- package/dist/tools/email.d.ts +2 -2
- package/dist/tools/email.js +2 -2
- package/dist/tools/enrichment.d.ts +2 -2
- package/dist/tools/gov.d.ts +4 -0
- package/dist/tools/gov.js +36 -0
- package/dist/tools/inbox.d.ts +2 -2
- package/dist/tools/index.d.ts +9 -2
- package/dist/tools/index.js +45 -1
- package/dist/tools/local.d.ts +6 -0
- package/dist/tools/local.js +60 -0
- package/dist/tools/notifications.d.ts +2 -2
- package/dist/tools/nyne.d.ts +2 -2
- package/dist/tools/people.d.ts +2 -2
- package/dist/tools/research.d.ts +2 -2
- package/dist/tools/search.d.ts +2 -2
- package/dist/tools/sms-inbox.d.ts +2 -2
- package/dist/tools/sms.d.ts +2 -2
- package/dist/tools/voice.d.ts +2 -2
- package/dist/tools/wallet.d.ts +2 -2
- package/dist/tools/wallet.js +2 -1
- package/dist/tools/web-read.d.ts +2 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ npm install -g @oneshot-agent/mcp-server
|
|
|
10
10
|
|
|
11
11
|
## Configuration
|
|
12
12
|
|
|
13
|
-
The server supports
|
|
13
|
+
The server supports three auth methods: **CDP Wallet** (recommended, no private keys in config), a raw private key, or an **access token** (credits-only session, no key at all — see Remote below).
|
|
14
14
|
|
|
15
15
|
### Environment Variables
|
|
16
16
|
|
|
@@ -20,6 +20,7 @@ The server supports two auth methods: **CDP Wallet** (recommended, no private ke
|
|
|
20
20
|
| `CDP_API_KEY_SECRET` | Option A | Coinbase CDP API key secret |
|
|
21
21
|
| `CDP_WALLET_SECRET` | Option A | Coinbase CDP wallet secret |
|
|
22
22
|
| `ONESHOT_WALLET_PRIVATE_KEY` | Option B | Raw private key for signing payments |
|
|
23
|
+
| `ONESHOT_ACCESS_TOKEN` | Option C | Agent access token (`oneshot_…`): credits-only session, cannot be combined with `ONESHOT_BUDGET_*` |
|
|
23
24
|
| `ONESHOT_BUDGET_DAILY` | No | Max USDC the agent may spend per UTC day (spend budget, enforced server-side) |
|
|
24
25
|
| `ONESHOT_BUDGET_PER_TRANSACTION` | No | Max USDC for any single call |
|
|
25
26
|
| `ONESHOT_BUDGET_ALERT_AT` | No | Fraction of the daily budget that triggers a warning (default 0.8) |
|
|
@@ -92,6 +93,30 @@ Get CDP credentials at [Coinbase Agentic Wallet](https://docs.cdp.coinbase.com/a
|
|
|
92
93
|
|
|
93
94
|
Read tools (inbox, SMS inbox, notifications, balance, browser profiles) return private, per-agent data. The server wraps the OneShot TypeScript SDK, which automatically signs a short-lived **EIP-712 read proof** (`x-agent-proof`) on each read so the API can verify you control the `X-Agent-ID` wallet. No configuration needed — this ships via `@oneshot-agent/sdk >= 0.25.0` (the bundled dependency). Read-proof verification is rolling out in log-only mode server-side, so older callers keep working until enforcement is enabled.
|
|
94
95
|
|
|
96
|
+
## Remote (hosted)
|
|
97
|
+
|
|
98
|
+
Clients that run in someone else's cloud — Grok Bot, hosted runners — cannot spawn this
|
|
99
|
+
server and must not hold a wallet key. For them OneShot hosts the same 50 tools over
|
|
100
|
+
Streamable HTTP at **`https://win.oneshotagent.com/mcp`**, authenticated with an
|
|
101
|
+
**agent access token** and billed to the agent's credit balance:
|
|
102
|
+
|
|
103
|
+
```json
|
|
104
|
+
{
|
|
105
|
+
"mcpServers": {
|
|
106
|
+
"oneshot": {
|
|
107
|
+
"url": "https://win.oneshotagent.com/mcp",
|
|
108
|
+
"headers": { "Authorization": "Bearer ${env:ONESHOT_ACCESS_TOKEN}" }
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Mint a token from a wallet session with `agent.createAccessToken()` (`@oneshot-agent/sdk`
|
|
115
|
+
≥ 0.33.0). Setup and billing details: https://docs.oneshotagent.com/sdk/remote-mcp
|
|
116
|
+
|
|
117
|
+
The same token also works with this local server (≥ 0.20.0): set `ONESHOT_ACCESS_TOKEN`
|
|
118
|
+
instead of the wallet variables for a credits-only session on your own machine.
|
|
119
|
+
|
|
95
120
|
## Available Tools
|
|
96
121
|
|
|
97
122
|
### Communication
|
|
@@ -122,6 +147,9 @@ Read tools (inbox, SMS inbox, notifications, balance, browser profiles) return p
|
|
|
122
147
|
| `oneshot_verify_email` | Verify email deliverability |
|
|
123
148
|
| `oneshot_company_search` | Search for companies by industry, size, location, etc. |
|
|
124
149
|
| `oneshot_enrich_company` | Enrich a company from domain, name, LinkedIn, or ticker |
|
|
150
|
+
| `oneshot_local_search` | Discover local businesses (restaurants, contractors, practices) by category × location |
|
|
151
|
+
| `oneshot_local_resolve` | Business name + address → website domain, phone, status, confidence |
|
|
152
|
+
| `oneshot_gov_solicitations` | Federal Sources Sought / Presolicitation notices by NAICS with the contracting officer's contact |
|
|
125
153
|
|
|
126
154
|
### Person Intelligence
|
|
127
155
|
|
|
@@ -204,8 +232,9 @@ Use oneshot_email:
|
|
|
204
232
|
- subject: "Hello from AI"
|
|
205
233
|
- body: "<h1>Hello!</h1><p>This email was sent by an AI agent.</p>"
|
|
206
234
|
- from_name: "Jane Doe" (optional display name → "Jane Doe <jane@domain>")
|
|
207
|
-
- from_mailbox: "jane" (optional local-part, defaults to "agent")
|
|
208
|
-
- from_domain: "acme.com" (optional,
|
|
235
|
+
- from_mailbox: "jane" (optional local-part, defaults to "agent"; requires from_domain)
|
|
236
|
+
- from_domain: "acme.com" (optional, must be a domain you own; omit both from_domain and
|
|
237
|
+
from_mailbox to rotate across your warmed domains)
|
|
209
238
|
- mailbox_mode: "mailbox" (optional, 'relay' (default) | 'mailbox' — dedicated per-address
|
|
210
239
|
mailbox; only when first provisioning a new from_domain)
|
|
211
240
|
```
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import { tools, handleToolCall } from "./tools/index.js";
|
|
|
7
7
|
import { budgetConfigFromEnv } from "./budget-env.js";
|
|
8
8
|
const CDP_KEY_ID = process.env.CDP_API_KEY_ID;
|
|
9
9
|
const PRIVATE_KEY = process.env.ONESHOT_WALLET_PRIVATE_KEY;
|
|
10
|
+
const ACCESS_TOKEN = process.env.ONESHOT_ACCESS_TOKEN;
|
|
10
11
|
async function initAgent() {
|
|
11
12
|
let budget;
|
|
12
13
|
try {
|
|
@@ -19,6 +20,19 @@ async function initAgent() {
|
|
|
19
20
|
}
|
|
20
21
|
if (budget.budgets)
|
|
21
22
|
console.error(`Spend budget: ${JSON.stringify(budget.budgets)}`);
|
|
23
|
+
if (ACCESS_TOKEN) {
|
|
24
|
+
// Option C: agent access token — credits-only, no key on this machine.
|
|
25
|
+
// Budgets are read-only for a token (a cap the token could raise is not
|
|
26
|
+
// a cap), so ONESHOT_BUDGET_* alongside it is a misconfiguration, not
|
|
27
|
+
// something to silently drop.
|
|
28
|
+
if (budget.budgets || budget.alerts) {
|
|
29
|
+
console.error("Error: ONESHOT_BUDGET_* cannot be combined with ONESHOT_ACCESS_TOKEN — budgets are read-only\n" +
|
|
30
|
+
" for access-token sessions. Set them from a wallet session (SDK budgets config or the API).");
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
console.error("Using access token (credits-only session)");
|
|
34
|
+
return OneShot.create({ accessToken: ACCESS_TOKEN });
|
|
35
|
+
}
|
|
22
36
|
if (CDP_KEY_ID) {
|
|
23
37
|
// Preferred: Coinbase CDP Server Wallet (no private key exposure)
|
|
24
38
|
console.error("Using Coinbase CDP wallet");
|
|
@@ -28,8 +42,8 @@ async function initAgent() {
|
|
|
28
42
|
// Fallback: raw private key
|
|
29
43
|
return new OneShot({ privateKey: PRIVATE_KEY, ...budget });
|
|
30
44
|
}
|
|
31
|
-
console.error("Error: Set CDP_API_KEY_ID + CDP_API_KEY_SECRET + CDP_WALLET_SECRET (recommended)
|
|
32
|
-
" or
|
|
45
|
+
console.error("Error: Set CDP_API_KEY_ID + CDP_API_KEY_SECRET + CDP_WALLET_SECRET (recommended),\n" +
|
|
46
|
+
" ONESHOT_WALLET_PRIVATE_KEY, or ONESHOT_ACCESS_TOKEN (credits-only session)");
|
|
33
47
|
process.exit(1);
|
|
34
48
|
}
|
|
35
49
|
// Start server
|
|
@@ -38,7 +52,7 @@ async function main() {
|
|
|
38
52
|
// Create MCP server
|
|
39
53
|
const server = new Server({
|
|
40
54
|
name: "oneshot-mcp",
|
|
41
|
-
version: "0.
|
|
55
|
+
version: "0.20.0", // keep in sync with package.json; guarded by version.test.ts
|
|
42
56
|
}, {
|
|
43
57
|
capabilities: {
|
|
44
58
|
tools: {},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
-
import { OneShot } from "@oneshot-agent/sdk";
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import type { OneShot } from "@oneshot-agent/sdk";
|
|
3
3
|
export declare const spendBreakdownTool: Tool;
|
|
4
4
|
export declare const rocsTool: Tool;
|
|
5
5
|
export declare const receiptsListTool: Tool;
|
package/dist/tools/browser.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
-
import { OneShot } from "@oneshot-agent/sdk";
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import type { OneShot } from "@oneshot-agent/sdk";
|
|
3
3
|
export declare const browserTool: Tool;
|
|
4
4
|
export declare const browserCreateProfileTool: Tool;
|
|
5
5
|
export declare const browserListProfilesTool: Tool;
|
package/dist/tools/build.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
-
import { OneShot } from "@oneshot-agent/sdk";
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import type { OneShot } from "@oneshot-agent/sdk";
|
|
3
3
|
export declare const buildTool: Tool;
|
|
4
4
|
export declare const updateBuildTool: Tool;
|
|
5
5
|
export declare function handleBuild(agent: OneShot, args: Record<string, unknown>): Promise<import("@oneshot-agent/sdk").BuildResult>;
|
package/dist/tools/commerce.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
-
import { OneShot } from "@oneshot-agent/sdk";
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import type { OneShot } from "@oneshot-agent/sdk";
|
|
3
3
|
export declare const commerceSearchTool: Tool;
|
|
4
4
|
export declare const commerceBuyTool: Tool;
|
|
5
5
|
export declare function handleCommerceSearch(agent: OneShot, args: Record<string, unknown>): Promise<import("@oneshot-agent/sdk").CommerceSearchResult>;
|
package/dist/tools/company.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
-
import { OneShot } from "@oneshot-agent/sdk";
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import type { OneShot } from "@oneshot-agent/sdk";
|
|
3
3
|
export declare const companySearchTool: Tool;
|
|
4
4
|
export declare const enrichCompanyTool: Tool;
|
|
5
5
|
export declare function handleCompanySearch(agent: OneShot, args: Record<string, unknown>): Promise<import("@oneshot-agent/sdk").CompanySearchResult>;
|
package/dist/tools/compute.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
-
import { OneShot } from "@oneshot-agent/sdk";
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import type { OneShot } from "@oneshot-agent/sdk";
|
|
3
3
|
export declare const computeTool: Tool;
|
|
4
4
|
export declare const computeStatusTool: Tool;
|
|
5
5
|
export declare const computeTasksTool: Tool;
|
package/dist/tools/domains.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
-
import { OneShot } from "@oneshot-agent/sdk";
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import type { OneShot } from "@oneshot-agent/sdk";
|
|
3
3
|
export declare const listDomainsTool: Tool;
|
|
4
4
|
export declare const pauseDomainTool: Tool;
|
|
5
5
|
export declare const resumeDomainTool: Tool;
|
package/dist/tools/email.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
-
import { OneShot } from "@oneshot-agent/sdk";
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import type { OneShot } from "@oneshot-agent/sdk";
|
|
3
3
|
export declare const emailTool: Tool;
|
|
4
4
|
export declare function handleEmail(agent: OneShot, args: Record<string, unknown>): Promise<import("@oneshot-agent/sdk").EmailResult>;
|
package/dist/tools/email.js
CHANGED
|
@@ -22,11 +22,11 @@ export const emailTool = {
|
|
|
22
22
|
},
|
|
23
23
|
from_domain: {
|
|
24
24
|
type: "string",
|
|
25
|
-
description: "
|
|
25
|
+
description: "Domain to send from (must be one you own). Omit both from_domain and from_mailbox to rotate across your warmed domains — the chosen address comes back on the quote.",
|
|
26
26
|
},
|
|
27
27
|
from_mailbox: {
|
|
28
28
|
type: "string",
|
|
29
|
-
description: "Sender mailbox / local-part (optional, defaults to 'agent', i.e. agent@from_domain). You can use any local-part — a new address is auto-provisioned on first use (starts unwarmed, warms over time). The FIRST send from any address — including the default 'agent@' — adds a one-time mailbox_provisioning_fee to the quote; it's free only once that address is already provisioned (active). See the domains list for each domain's default_from and existing addresses.",
|
|
29
|
+
description: "Sender mailbox / local-part (optional, defaults to 'agent', i.e. agent@from_domain). Requires from_domain to be set — pinning from_mailbox alone is rejected, since there is no domain to attach it to. You can use any local-part — a new address is auto-provisioned on first use (starts unwarmed, warms over time). The FIRST send from any address — including the default 'agent@' — adds a one-time mailbox_provisioning_fee to the quote; it's free only once that address is already provisioned (active). See the domains list for each domain's default_from and existing addresses.",
|
|
30
30
|
},
|
|
31
31
|
from_name: {
|
|
32
32
|
type: "string",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
-
import { OneShot } from "@oneshot-agent/sdk";
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import type { OneShot } from "@oneshot-agent/sdk";
|
|
3
3
|
export declare const enrichProfileTool: Tool;
|
|
4
4
|
export declare const findEmailTool: Tool;
|
|
5
5
|
export declare const verifyEmailTool: Tool;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import type { OneShot } from "@oneshot-agent/sdk";
|
|
3
|
+
export declare const govSolicitationsTool: Tool;
|
|
4
|
+
export declare function handleGovSolicitations(agent: OneShot, args: Record<string, unknown>): Promise<import("@oneshot-agent/sdk").GovSolicitationsResult>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export const govSolicitationsTool = {
|
|
2
|
+
name: "oneshot_gov_solicitations",
|
|
3
|
+
description: "Federal contract opportunities (SAM.gov) by NAICS code — Sources Sought and Presolicitation notices with the contracting officer's published name and email, agency, response deadline, set-aside, and description. Use for government buyers instead of people_search. Flat price per search. Paid tool.",
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: "object",
|
|
6
|
+
properties: {
|
|
7
|
+
naics: { type: "array", items: { type: "string" }, description: "6-digit NAICS codes, 1-20 (required)" },
|
|
8
|
+
notice_types: { type: "array", items: { type: "string", enum: ["r", "p", "o", "k", "s", "a", "u", "i", "g"] }, description: "r=Sources Sought, p=Presolicitation, o=Solicitation, k=Combined Synopsis, s=Special Notice, a=Award. Default ['r','p']" },
|
|
9
|
+
since_days: { type: "number", description: "Look-back window on posted date, 1-365 (default 30)" },
|
|
10
|
+
agencies: { type: "array", items: { type: "string" }, description: "Agency-name substrings to keep" },
|
|
11
|
+
keywords: { type: "array", items: { type: "string" }, description: "Title / full-text keywords" },
|
|
12
|
+
state: { type: "string", description: "Place-of-performance state code, e.g. 'TX'" },
|
|
13
|
+
set_aside: { type: "string", description: "Set-aside code: SBA, 8A, HZC, SDVOSBC, WOSB, ..." },
|
|
14
|
+
active_only: { type: "boolean", description: "Default true: drop archived notices and past deadlines" },
|
|
15
|
+
has_contact: { type: "boolean", description: "Only notices with a name + email point of contact" },
|
|
16
|
+
include_description: { type: "boolean", description: "Default true: fetch description bodies for the first rows" },
|
|
17
|
+
limit: { type: "number", description: "Max results (1-500, default 100)" },
|
|
18
|
+
},
|
|
19
|
+
required: ["naics"],
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
export async function handleGovSolicitations(agent, args) {
|
|
23
|
+
return agent.govSolicitations({
|
|
24
|
+
naics: args.naics,
|
|
25
|
+
notice_types: args.notice_types,
|
|
26
|
+
since_days: args.since_days,
|
|
27
|
+
agencies: args.agencies,
|
|
28
|
+
keywords: args.keywords,
|
|
29
|
+
state: args.state,
|
|
30
|
+
set_aside: args.set_aside,
|
|
31
|
+
active_only: args.active_only,
|
|
32
|
+
has_contact: args.has_contact,
|
|
33
|
+
include_description: args.include_description,
|
|
34
|
+
limit: args.limit,
|
|
35
|
+
});
|
|
36
|
+
}
|
package/dist/tools/inbox.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
-
import { OneShot } from "@oneshot-agent/sdk";
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import type { OneShot } from "@oneshot-agent/sdk";
|
|
3
3
|
export declare const inboxListTool: Tool;
|
|
4
4
|
export declare const inboxGetTool: Tool;
|
|
5
5
|
export declare function handleInboxList(agent: OneShot, args: Record<string, unknown>): Promise<import("@oneshot-agent/sdk").InboxListResult>;
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
-
import { OneShot } from "@oneshot-agent/sdk";
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import type { OneShot } from "@oneshot-agent/sdk";
|
|
3
3
|
export declare const tools: Tool[];
|
|
4
4
|
export declare function handleToolCall(agent: OneShot, toolName: string, args: Record<string, unknown>): Promise<{
|
|
5
5
|
content: {
|
|
@@ -14,3 +14,10 @@ export declare function handleToolCall(agent: OneShot, toolName: string, args: R
|
|
|
14
14
|
}[];
|
|
15
15
|
isError?: undefined;
|
|
16
16
|
}>;
|
|
17
|
+
/**
|
|
18
|
+
* Typed SDK errors become a JSON body the model can act on instead of a
|
|
19
|
+
* prose string. Matched on `name`, never `instanceof`: the hosted server runs
|
|
20
|
+
* the workspace SDK while this registry's types come from the published one,
|
|
21
|
+
* so the classes are different objects at runtime.
|
|
22
|
+
*/
|
|
23
|
+
export declare function structuredToolError(error: unknown): Record<string, unknown> | undefined;
|
package/dist/tools/index.js
CHANGED
|
@@ -15,6 +15,8 @@ import { webSearchTool, handleWebSearch } from "./search.js";
|
|
|
15
15
|
import { webReadTool, handleWebRead } from "./web-read.js";
|
|
16
16
|
import { deepResearchPersonTool, socialProfilesTool, articleSearchTool, personNewsfeedTool, personInterestsTool, personInteractionsTool, handleDeepResearchPerson, handleSocialProfiles, handleArticleSearch, handlePersonNewsfeed, handlePersonInterests, handlePersonInteractions } from "./nyne.js";
|
|
17
17
|
import { companySearchTool, enrichCompanyTool, handleCompanySearch, handleEnrichCompany } from "./company.js";
|
|
18
|
+
import { localSearchTool, localResolveTool, handleLocalSearch, handleLocalResolve } from "./local.js";
|
|
19
|
+
import { govSolicitationsTool, handleGovSolicitations } from "./gov.js";
|
|
18
20
|
import { computeTool, computeStatusTool, computeTasksTool, computeCancelTool, computeRespondTool, handleCompute, handleComputeStatus, handleComputeTasks, handleComputeCancel, handleComputeRespond } from "./compute.js";
|
|
19
21
|
import { listDomainsTool, pauseDomainTool, resumeDomainTool, handleListDomains, handlePauseDomain, handleResumeDomain } from "./domains.js";
|
|
20
22
|
import { spendBreakdownTool, rocsTool, rocsByGoalTool, receiptsListTool, tagReceiptValueTool, handleSpendBreakdown, handleRocs, handleRocsByGoal, handleReceiptsList, handleTagReceiptValue } from "./analytics.js";
|
|
@@ -44,6 +46,9 @@ export const tools = [
|
|
|
44
46
|
personInteractionsTool,
|
|
45
47
|
companySearchTool,
|
|
46
48
|
enrichCompanyTool,
|
|
49
|
+
localSearchTool,
|
|
50
|
+
localResolveTool,
|
|
51
|
+
govSolicitationsTool,
|
|
47
52
|
// Commerce
|
|
48
53
|
commerceSearchTool,
|
|
49
54
|
commerceBuyTool,
|
|
@@ -105,6 +110,9 @@ const handlers = {
|
|
|
105
110
|
"oneshot_person_interactions": handlePersonInteractions,
|
|
106
111
|
"oneshot_company_search": handleCompanySearch,
|
|
107
112
|
"oneshot_enrich_company": handleEnrichCompany,
|
|
113
|
+
"oneshot_local_search": handleLocalSearch,
|
|
114
|
+
"oneshot_local_resolve": handleLocalResolve,
|
|
115
|
+
"oneshot_gov_solicitations": handleGovSolicitations,
|
|
108
116
|
// Commerce
|
|
109
117
|
"oneshot_commerce_search": handleCommerceSearch,
|
|
110
118
|
"oneshot_commerce_buy": handleCommerceBuy,
|
|
@@ -156,9 +164,45 @@ export async function handleToolCall(agent, toolName, args) {
|
|
|
156
164
|
}
|
|
157
165
|
catch (error) {
|
|
158
166
|
const message = error instanceof Error ? error.message : String(error);
|
|
167
|
+
const structured = structuredToolError(error);
|
|
159
168
|
return {
|
|
160
|
-
content: [{ type: "text", text: `Error: ${message}` }],
|
|
169
|
+
content: [{ type: "text", text: structured ? JSON.stringify(structured, null, 2) : `Error: ${message}` }],
|
|
161
170
|
isError: true,
|
|
162
171
|
};
|
|
163
172
|
}
|
|
164
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* Typed SDK errors become a JSON body the model can act on instead of a
|
|
176
|
+
* prose string. Matched on `name`, never `instanceof`: the hosted server runs
|
|
177
|
+
* the workspace SDK while this registry's types come from the published one,
|
|
178
|
+
* so the classes are different objects at runtime.
|
|
179
|
+
*/
|
|
180
|
+
export function structuredToolError(error) {
|
|
181
|
+
const e = error;
|
|
182
|
+
if (!e || typeof e !== "object")
|
|
183
|
+
return undefined;
|
|
184
|
+
switch (e.name) {
|
|
185
|
+
case "BudgetExceededError":
|
|
186
|
+
return {
|
|
187
|
+
error: "budget_exceeded",
|
|
188
|
+
message: e.message,
|
|
189
|
+
reason: e.reason,
|
|
190
|
+
cap: e.cap,
|
|
191
|
+
spent: e.spent,
|
|
192
|
+
charge: e.charge,
|
|
193
|
+
resets_at: e.resetsAt,
|
|
194
|
+
};
|
|
195
|
+
case "InsufficientCreditsError":
|
|
196
|
+
return {
|
|
197
|
+
error: "insufficient_credits",
|
|
198
|
+
message: e.message,
|
|
199
|
+
required_usdc: e.required,
|
|
200
|
+
credits_balance: e.balance,
|
|
201
|
+
shortfall_usdc: e.shortfall,
|
|
202
|
+
};
|
|
203
|
+
case "PaymentError":
|
|
204
|
+
return { error: "payment_failed", message: e.message, reason: e.reason };
|
|
205
|
+
default:
|
|
206
|
+
return undefined;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import type { OneShot } from "@oneshot-agent/sdk";
|
|
3
|
+
export declare const localSearchTool: Tool;
|
|
4
|
+
export declare const localResolveTool: Tool;
|
|
5
|
+
export declare function handleLocalSearch(agent: OneShot, args: Record<string, unknown>): Promise<import("@oneshot-agent/sdk").LocalSearchResult>;
|
|
6
|
+
export declare function handleLocalResolve(agent: OneShot, args: Record<string, unknown>): Promise<import("@oneshot-agent/sdk").LocalResolveResult>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export const localSearchTool = {
|
|
2
|
+
name: "oneshot_local_search",
|
|
3
|
+
description: "Discover local main-street businesses (restaurants, contractors, dental practices, auto shops) by category or keywords in a location. Use this instead of people_search for independent local businesses. Flat price per search. Paid tool.",
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: "object",
|
|
6
|
+
properties: {
|
|
7
|
+
category: { type: "array", items: { type: "string" }, description: "Business categories, e.g. ['hvac contractor', 'dental practice']. category or keywords required." },
|
|
8
|
+
keywords: { type: "array", items: { type: "string" }, description: "Free-text keywords (alternative to category)" },
|
|
9
|
+
location: { type: "array", items: { type: "string" }, description: "Cities, neighborhoods, or 'City, ST' strings (required)" },
|
|
10
|
+
min_rating: { type: "number", description: "Minimum star rating (0-5)" },
|
|
11
|
+
min_review_count: { type: "number", description: "Minimum review count" },
|
|
12
|
+
is_chain: { type: "boolean", description: "true = only chains, false = exclude detected chains" },
|
|
13
|
+
operating_status: { type: "string", enum: ["open", "any"], description: "Default 'open' drops closed businesses" },
|
|
14
|
+
has_domain: { type: "boolean", description: "true = only rows with a resolvable website domain" },
|
|
15
|
+
limit: { type: "number", description: "Max results (1-500, default 100)" },
|
|
16
|
+
},
|
|
17
|
+
required: ["location"],
|
|
18
|
+
anyOf: [{ required: ["category"] }, { required: ["keywords"] }],
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
export const localResolveTool = {
|
|
22
|
+
name: "oneshot_local_resolve",
|
|
23
|
+
description: "Resolve a local business name plus one locating field (address, city, postal code, or phone) to its website domain, phone, category, and operating status with a match confidence. A miss returns found=false, not an error. Paid tool.",
|
|
24
|
+
inputSchema: {
|
|
25
|
+
type: "object",
|
|
26
|
+
properties: {
|
|
27
|
+
name: { type: "string", description: "Business name" },
|
|
28
|
+
address: { type: "string", description: "Street address" },
|
|
29
|
+
city: { type: "string", description: "City" },
|
|
30
|
+
region: { type: "string", description: "State / province" },
|
|
31
|
+
postal_code: { type: "string", description: "Postal code" },
|
|
32
|
+
phone: { type: "string", description: "Phone number (strong match signal)" },
|
|
33
|
+
},
|
|
34
|
+
required: ["name"],
|
|
35
|
+
anyOf: [{ required: ["address"] }, { required: ["city"] }, { required: ["postal_code"] }, { required: ["phone"] }],
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
export async function handleLocalSearch(agent, args) {
|
|
39
|
+
return agent.localSearch({
|
|
40
|
+
category: args.category,
|
|
41
|
+
keywords: args.keywords,
|
|
42
|
+
location: args.location,
|
|
43
|
+
min_rating: args.min_rating,
|
|
44
|
+
min_review_count: args.min_review_count,
|
|
45
|
+
is_chain: args.is_chain,
|
|
46
|
+
operating_status: args.operating_status,
|
|
47
|
+
has_domain: args.has_domain,
|
|
48
|
+
limit: args.limit,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
export async function handleLocalResolve(agent, args) {
|
|
52
|
+
return agent.localResolve({
|
|
53
|
+
name: args.name,
|
|
54
|
+
address: args.address,
|
|
55
|
+
city: args.city,
|
|
56
|
+
region: args.region,
|
|
57
|
+
postal_code: args.postal_code,
|
|
58
|
+
phone: args.phone,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
-
import { OneShot } from "@oneshot-agent/sdk";
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import type { OneShot } from "@oneshot-agent/sdk";
|
|
3
3
|
export declare const notificationsTool: Tool;
|
|
4
4
|
export declare const markReadTool: Tool;
|
|
5
5
|
export declare function handleNotifications(agent: OneShot, args: Record<string, unknown>): Promise<import("@oneshot-agent/sdk").NotificationsResult>;
|
package/dist/tools/nyne.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
-
import { OneShot } from "@oneshot-agent/sdk";
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import type { OneShot } from "@oneshot-agent/sdk";
|
|
3
3
|
export declare const deepResearchPersonTool: Tool;
|
|
4
4
|
export declare const socialProfilesTool: Tool;
|
|
5
5
|
export declare const articleSearchTool: Tool;
|
package/dist/tools/people.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
-
import { OneShot } from "@oneshot-agent/sdk";
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import type { OneShot } from "@oneshot-agent/sdk";
|
|
3
3
|
export declare const peopleSearchTool: Tool;
|
|
4
4
|
export declare function handlePeopleSearch(agent: OneShot, args: Record<string, unknown>): Promise<import("@oneshot-agent/sdk").PeopleSearchResult>;
|
package/dist/tools/research.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
-
import { OneShot } from "@oneshot-agent/sdk";
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import type { OneShot } from "@oneshot-agent/sdk";
|
|
3
3
|
export declare const researchTool: Tool;
|
|
4
4
|
/**
|
|
5
5
|
* Wait budget per depth. The SDK's default is 120s, but deep research runs
|
package/dist/tools/search.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
-
import { OneShot } from "@oneshot-agent/sdk";
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import type { OneShot } from "@oneshot-agent/sdk";
|
|
3
3
|
export declare const webSearchTool: Tool;
|
|
4
4
|
export declare function handleWebSearch(agent: OneShot, args: Record<string, unknown>): Promise<import("@oneshot-agent/sdk").WebSearchResult>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
-
import { OneShot } from "@oneshot-agent/sdk";
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import type { OneShot } from "@oneshot-agent/sdk";
|
|
3
3
|
export declare const smsInboxListTool: Tool;
|
|
4
4
|
export declare const smsInboxGetTool: Tool;
|
|
5
5
|
export declare function handleSmsInboxList(agent: OneShot, args: Record<string, unknown>): Promise<import("@oneshot-agent/sdk").SmsInboxResult>;
|
package/dist/tools/sms.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
-
import { OneShot } from "@oneshot-agent/sdk";
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import type { OneShot } from "@oneshot-agent/sdk";
|
|
3
3
|
export declare const smsTool: Tool;
|
|
4
4
|
export declare function handleSms(agent: OneShot, args: Record<string, unknown>): Promise<import("@oneshot-agent/sdk").SmsSendResult>;
|
package/dist/tools/voice.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
-
import { OneShot } from "@oneshot-agent/sdk";
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import type { OneShot } from "@oneshot-agent/sdk";
|
|
3
3
|
export declare const voiceTool: Tool;
|
|
4
4
|
export declare function handleVoice(agent: OneShot, args: Record<string, unknown>): Promise<import("@oneshot-agent/sdk").VoiceCallResult>;
|
package/dist/tools/wallet.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
-
import { OneShot } from "@oneshot-agent/sdk";
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import type { OneShot } from "@oneshot-agent/sdk";
|
|
3
3
|
export declare const getBalanceTool: Tool;
|
|
4
4
|
export declare function handleGetBalance(agent: OneShot, _args: Record<string, unknown>): Promise<import("@oneshot-agent/sdk").UnifiedBalance>;
|
|
5
5
|
export declare const budgetStatusTool: Tool;
|
package/dist/tools/wallet.js
CHANGED
|
@@ -15,7 +15,8 @@ export const budgetStatusTool = {
|
|
|
15
15
|
description: "Read-only: today's spend versus the agent's configured spend budget — daily cap, per-call cap, " +
|
|
16
16
|
"spent_today_usdc, remaining_usdc, pct_used and resets_at (next UTC midnight). Use it to plan " +
|
|
17
17
|
"remaining work; paid calls are rejected with budget_exceeded once the cap is reached. The budget " +
|
|
18
|
-
"itself is set by the operator
|
|
18
|
+
"itself is set by the operator (ONESHOT_BUDGET_* env vars on a local server, the SDK or API for the " +
|
|
19
|
+
"hosted endpoint) and cannot be changed from here. Free.",
|
|
19
20
|
inputSchema: {
|
|
20
21
|
type: "object",
|
|
21
22
|
properties: {},
|
package/dist/tools/web-read.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
-
import { OneShot } from "@oneshot-agent/sdk";
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import type { OneShot } from "@oneshot-agent/sdk";
|
|
3
3
|
export declare const webReadTool: Tool;
|
|
4
4
|
export declare function handleWebRead(agent: OneShot, args: Record<string, unknown>): Promise<import("@oneshot-agent/sdk").WebReadResult>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oneshot-agent/mcp-server",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "MCP server for OneShot -
|
|
3
|
+
"version": "0.20.0",
|
|
4
|
+
"description": "MCP server for OneShot - 50 tools for AI agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@coinbase/cdp-sdk": "1.45.0",
|
|
27
27
|
"@modelcontextprotocol/sdk": "1.27.1",
|
|
28
|
-
"@oneshot-agent/sdk": "^0.
|
|
28
|
+
"@oneshot-agent/sdk": "^0.33.0",
|
|
29
29
|
"zod": "3.25.76"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|