govtoolspro-mcp-server 0.1.2 → 0.1.4
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 +26 -2
- package/dist/api/client.js +1 -1
- package/dist/api/client.js.map +1 -1
- package/dist/index.js +32 -27
- package/dist/index.js.map +1 -1
- package/dist/tool-kit/mcp.js +21 -0
- package/dist/tool-kit/mcp.js.map +1 -0
- package/dist/tool-kit/types.js +8 -0
- package/dist/tool-kit/types.js.map +1 -0
- package/dist/tools/analyzeAwardPatterns.js +72 -0
- package/dist/tools/analyzeAwardPatterns.js.map +1 -0
- package/dist/tools/analyzeMarket.js +79 -0
- package/dist/tools/analyzeMarket.js.map +1 -0
- package/dist/tools/balance.js +17 -18
- package/dist/tools/balance.js.map +1 -1
- package/dist/tools/findIncumbents.js +31 -32
- package/dist/tools/findIncumbents.js.map +1 -1
- package/dist/tools/findPartnersNear.js +29 -28
- package/dist/tools/findPartnersNear.js.map +1 -1
- package/dist/tools/getSolicitation.js +36 -37
- package/dist/tools/getSolicitation.js.map +1 -1
- package/dist/tools/lookupLaborRates.js +87 -0
- package/dist/tools/lookupLaborRates.js.map +1 -0
- package/dist/tools/lookupNecoData.js +33 -34
- package/dist/tools/lookupNecoData.js.map +1 -1
- package/dist/tools/predictRecompete.js +26 -27
- package/dist/tools/predictRecompete.js.map +1 -1
- package/dist/tools/scoreGoNoGo.js +30 -31
- package/dist/tools/scoreGoNoGo.js.map +1 -1
- package/package.json +53 -52
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
[](https://smithery.ai/servers/smythmyke/govtoolspro-mcp-server)
|
|
7
7
|
[](LICENSE)
|
|
8
8
|
|
|
9
|
-
An [MCP](https://modelcontextprotocol.io) server that gives Claude (and any MCP client) **workflow tools for federal contractors** — not raw data access, but decisions: go/no-go scoring, incumbent intelligence, teaming-partner search, recompete prediction, Navy NECO lookup,
|
|
9
|
+
An [MCP](https://modelcontextprotocol.io) server that gives Claude (and any MCP client) **workflow tools for federal contractors** — not raw data access, but decisions: go/no-go scoring, incumbent intelligence, teaming-partner search, recompete prediction, Navy NECO lookup, SAM.gov solicitation retrieval, and market intelligence (labor rates, award patterns, market analysis).
|
|
10
10
|
|
|
11
11
|
It wraps the live [GovToolsPro](https://govtoolspro.com) API. You bring an API key; the server proxies your calls.
|
|
12
12
|
|
|
@@ -21,8 +21,11 @@ It wraps the live [GovToolsPro](https://govtoolspro.com) API. You bring an API k
|
|
|
21
21
|
| `find_partners_near` | free | Rank nearby teaming partners / subcontractors by proximity for a place of performance. |
|
|
22
22
|
| `predict_recompete` | free | Discover expiring contracts (recompete opportunities) by NAICS/PSC/state/value, enriched with option-exercise signals. |
|
|
23
23
|
| `lookup_neco_data` | free | Parse a Navy NECO (neco.navy.mil) solicitation into structured fields. No other govcon MCP has this. |
|
|
24
|
+
| `lookup_labor_rates` | free | Benchmark federal labor rates for a NAICS / labor category — GSA CALC awarded ceiling rates + BLS OEWS wages with a government wrap estimate. |
|
|
25
|
+
| `analyze_award_patterns` | 3 credits | How contracts in a NAICS are awarded: award-size distribution, competition mix, bid intensity, contract vehicles, pricing types. |
|
|
26
|
+
| `analyze_market` | 5 credits | Market-intelligence snapshot for a NAICS: 5-year spend trend, industry size, top contractors + HHI concentration, set-aside mix, geography, contract vehicles. |
|
|
24
27
|
|
|
25
|
-
Every tool returns decision-support output with a disclaimer — verify against the official solicitation before relying on results.
|
|
28
|
+
Every tool returns decision-support output with a disclaimer — verify against the official solicitation before relying on results. Credits are drawn from the shared GovToolsPro pool (extension + API + connector all bill the same balance); free tools never deduct.
|
|
26
29
|
|
|
27
30
|
## Install
|
|
28
31
|
|
|
@@ -44,6 +47,16 @@ Add to your MCP client config (Claude Desktop, Claude Code, Cursor, Cline, Zed,
|
|
|
44
47
|
|
|
45
48
|
Create a key in the **GovToolsPro extension → Profile → API Keys** tab (format `gtp_live_...` / `gtp_test_...`).
|
|
46
49
|
|
|
50
|
+
## Use as a Claude connector (remote MCP)
|
|
51
|
+
|
|
52
|
+
Prefer not to run anything locally? GovToolsPro is also a hosted **remote MCP server** you can add to Claude as a connector — no install, no API key, sign in with your GovToolsPro account.
|
|
53
|
+
|
|
54
|
+
- **Remote MCP URL:** `https://mcp.govtoolspro.com/api/mcp`
|
|
55
|
+
- In Claude: **Settings → Connectors → Add custom connector**, paste the URL, and leave the OAuth fields blank (the server self-registers via Dynamic Client Registration).
|
|
56
|
+
- You'll be sent to **`auth.govtoolspro.com`** to sign in; Claude then connects over OAuth 2.1. Toggle the connector **on in a conversation** to use its tools.
|
|
57
|
+
|
|
58
|
+
The same 10 tools are available over the connector, billed against the same shared credit balance as the extension and the stdio package.
|
|
59
|
+
|
|
47
60
|
## Configuration
|
|
48
61
|
|
|
49
62
|
| Env var | Required | Default |
|
|
@@ -77,6 +90,17 @@ To point a client at your local build:
|
|
|
77
90
|
- **CUI safety.** The API rejects content with CUI / FOUO / Distribution-Statement markings; those rejections surface to the client as clear errors. Do not submit controlled content.
|
|
78
91
|
- **No warranty.** Output is decision support only — not legal, contractual, or award-outcome advice.
|
|
79
92
|
|
|
93
|
+
## Troubleshooting
|
|
94
|
+
|
|
95
|
+
| Symptom | Cause / fix |
|
|
96
|
+
|---|---|
|
|
97
|
+
| **`Out of credits` / 402** | Three tools are metered (`analyze_market` 5, `analyze_award_patterns` 3). Check `balance`, or top up at [govtoolspro.com](https://govtoolspro.com). Free tools never deduct. |
|
|
98
|
+
| **Connector keeps asking you to sign in / 401** | The remote connector requires OAuth — complete sign-in at `auth.govtoolspro.com`, then toggle the connector **on** in the conversation ("Search and tools"). |
|
|
99
|
+
| **`No data for this NAICS` (502)** | That NAICS has no federal activity in the window — **you are not charged**. Try a broader NAICS or fewer filters. |
|
|
100
|
+
| **CUI rejection error** | The API rejects content marked CUI / FOUO / Distribution-Statement. Remove controlled content and retry. |
|
|
101
|
+
| **`get_solicitation` returns nothing** | Use the 32-char notice ID from the `sam.gov/opp/<id>/view` URL. Some archived/cancelled notices may be unavailable. |
|
|
102
|
+
| **Invalid API key (stdio)** | Ensure `GOVTOOLSPRO_API_KEY` is a `gtp_live_…` / `gtp_test_…` key from the extension's **Profile → API Keys** tab. |
|
|
103
|
+
|
|
80
104
|
## License
|
|
81
105
|
|
|
82
106
|
MIT © Michael Smyth
|
package/dist/api/client.js
CHANGED
package/dist/api/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAKA,MAAM,gBAAgB,GAAG,8CAA8C,CAAC;AAExE,MAAM,OAAO,GAAG,OAAO,CAAC;AAOxB,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAGnC;IACA;IAHT,YACE,OAAe,EACR,MAAc,EACd,IAAY;QAEnB,KAAK,CAAC,OAAO,CAAC,CAAC;QAHR,WAAM,GAAN,MAAM,CAAQ;QACd,SAAI,GAAJ,IAAI,CAAQ;QAGnB,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF;AAED,MAAM,OAAO,oBAAoB;IACvB,MAAM,CAAS;IACf,OAAO,CAAS;IAExB,YAAY,IAAsB;QAChC,4EAA4E;QAC5E,wEAAwE;QACxE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC;QAChC,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,IAAI,gBAAgB,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACvE,CAAC;IAED,KAAK,CAAC,IAAI,CAAI,IAAY,EAAE,IAA6B;QACvD,OAAO,IAAI,CAAC,OAAO,CAAI,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,GAAG,CAAI,IAAY;QACvB,OAAO,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AC,CAAC,MAAM;gBACR,CAAC,CAAC,MAAM,EAAE,OAAO,IAAI,QAAQ,GAAG,CAAC,MAAM,EAAE,CAAC;YAC9C,MAAM,IAAI,mBAAmB,CAC3B,aAAa,CAAC,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,EACvC,GAAG,CAAC,MAAM,EACV,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,CAC1B,CAAC;QACJ,CAAC;QAED,MAAM,OAAO,GAAG,MAA2C,CAAC;QAC5D,OAAO;YACL,IAAI,EAAE,CAAC,OAAO,CAAC,IAAI,IAAI,MAAM,CAAM;YACnC,UAAU,EAAE,OAAO,CAAC,UAAU;SAC/B,CAAC;IACJ,CAAC;CACF;AAED,SAAS,aAAa,CAAC,MAAc;IACnC,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,GAAG;YACN,OAAO,iBAAiB,CAAC;QAC3B,KAAK,GAAG;YACN,OAAO,kBAAkB,CAAC;QAC5B,KAAK,GAAG;YACN,OAAO,mBAAmB,CAAC;QAC7B,KAAK,GAAG;YACN,OAAO,WAAW,CAAC;QACrB,KAAK,GAAG;YACN,OAAO,cAAc,CAAC;QACxB;YACE,OAAO,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,aAAa,CAAC;IAC1D,CAAC;AACH,CAAC;AAED,SAAS,aAAa,CAAC,MAAc,EAAE,OAAe;IACpD,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,GAAG;YACN,OAAO,iHAAiH,CAAC;QAC3H,KAAK,GAAG;YACN,OAAO,oFAAoF,CAAC;QAC9F,KAAK,GAAG;YACN,OAAO,+CAA+C,CAAC;QACzD;YACE,OAAO,OAAO,CAAC;IACnB,CAAC;AACH,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3,15 +3,19 @@ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
|
3
3
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
4
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
5
5
|
import { GovToolsProApiClient, GovToolsProApiError } from "./api/client.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
6
|
+
import { toMcpTool, runTool } from "./tool-kit/mcp.js";
|
|
7
|
+
import { balanceDef } from "./tools/balance.js";
|
|
8
|
+
import { getSolicitationDef } from "./tools/getSolicitation.js";
|
|
9
|
+
import { scoreGoNoGoDef } from "./tools/scoreGoNoGo.js";
|
|
10
|
+
import { findIncumbentsDef } from "./tools/findIncumbents.js";
|
|
11
|
+
import { findPartnersNearDef } from "./tools/findPartnersNear.js";
|
|
12
|
+
import { predictRecompeteDef } from "./tools/predictRecompete.js";
|
|
13
|
+
import { lookupNecoDataDef } from "./tools/lookupNecoData.js";
|
|
14
|
+
import { lookupLaborRatesDef } from "./tools/lookupLaborRates.js";
|
|
15
|
+
import { analyzeAwardPatternsDef } from "./tools/analyzeAwardPatterns.js";
|
|
16
|
+
import { analyzeMarketDef } from "./tools/analyzeMarket.js";
|
|
13
17
|
const SERVER_NAME = "govtoolspro";
|
|
14
|
-
const SERVER_VERSION = "0.1.
|
|
18
|
+
const SERVER_VERSION = "0.1.4";
|
|
15
19
|
async function main() {
|
|
16
20
|
// Lazy config: don't require the API key at startup, so `tools/list` works
|
|
17
21
|
// without credentials (better client UX + lets registries scan tools). A
|
|
@@ -20,30 +24,31 @@ async function main() {
|
|
|
20
24
|
const baseUrl = process.env.GOVTOOLSPRO_API_BASE;
|
|
21
25
|
const api = new GovToolsProApiClient({ apiKey, baseUrl });
|
|
22
26
|
const server = new Server({ name: SERVER_NAME, version: SERVER_VERSION }, { capabilities: { tools: {} } });
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
// Single source of truth: every tool is a canonical ToolDef. The MCP adapter
|
|
28
|
+
// emits the `tools/list` descriptors and runs `tools/call`. (The same defs
|
|
29
|
+
// can be re-registered as WebMCP in-page tools from a browser build.)
|
|
30
|
+
const registry = [
|
|
31
|
+
balanceDef,
|
|
32
|
+
getSolicitationDef,
|
|
33
|
+
scoreGoNoGoDef,
|
|
34
|
+
findIncumbentsDef,
|
|
35
|
+
findPartnersNearDef,
|
|
36
|
+
predictRecompeteDef,
|
|
37
|
+
lookupNecoDataDef,
|
|
38
|
+
lookupLaborRatesDef,
|
|
39
|
+
analyzeAwardPatternsDef,
|
|
40
|
+
analyzeMarketDef,
|
|
31
41
|
];
|
|
42
|
+
const registryByName = new Map(registry.map((d) => [d.name, d]));
|
|
43
|
+
const tools = registry.map(toMcpTool);
|
|
32
44
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools }));
|
|
33
45
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
34
46
|
const { name, arguments: args } = request.params;
|
|
35
47
|
try {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
case findIncumbentsTool.name: return await runFindIncumbents(api, args ?? {});
|
|
41
|
-
case findPartnersNearTool.name: return await runFindPartnersNear(api, args ?? {});
|
|
42
|
-
case predictRecompeteTool.name: return await runPredictRecompete(api, args ?? {});
|
|
43
|
-
case lookupNecoDataTool.name: return await runLookupNecoData(api, args ?? {});
|
|
44
|
-
default:
|
|
45
|
-
return errorResult(`Unknown tool: ${name}`);
|
|
46
|
-
}
|
|
48
|
+
const def = registryByName.get(name);
|
|
49
|
+
if (def)
|
|
50
|
+
return await runTool(def, api, args ?? {});
|
|
51
|
+
return errorResult(`Unknown tool: ${name}`);
|
|
47
52
|
}
|
|
48
53
|
catch (err) {
|
|
49
54
|
if (err instanceof GovToolsProApiError) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GAEvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GAEvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,MAAM,WAAW,GAAG,a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// MCP adapter: turns a canonical ToolDef into the two things the MCP server
|
|
2
|
+
// needs — a `tools/list` descriptor and a `tools/call` result.
|
|
3
|
+
/** Build the `tools/list` descriptor for a ToolDef. */
|
|
4
|
+
export function toMcpTool(def) {
|
|
5
|
+
return {
|
|
6
|
+
name: def.name,
|
|
7
|
+
description: def.description,
|
|
8
|
+
inputSchema: def.inputSchema,
|
|
9
|
+
outputSchema: def.outputSchema,
|
|
10
|
+
annotations: def.annotations,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
/** Execute a ToolDef and shape its output as an MCP `tools/call` result. */
|
|
14
|
+
export async function runTool(def, ctx, args) {
|
|
15
|
+
const { data, disclaimer } = await def.run(ctx, args);
|
|
16
|
+
return {
|
|
17
|
+
content: [{ type: "text", text: def.toText(data, disclaimer, args) }],
|
|
18
|
+
structuredContent: data,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=mcp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../src/tool-kit/mcp.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,+DAA+D;AAK/D,uDAAuD;AACvD,MAAM,UAAU,SAAS,CAAC,GAAY;IACpC,OAAO;QACL,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,WAAW,EAAE,GAAG,CAAC,WAAW;QAC5B,WAAW,EAAE,GAAG,CAAC,WAAW;QAC5B,YAAY,EAAE,GAAG,CAAC,YAAY;QAC9B,WAAW,EAAE,GAAG,CAAC,WAAW;KACV,CAAC;AACvB,CAAC;AAED,4EAA4E;AAC5E,MAAM,CAAC,KAAK,UAAU,OAAO,CAC3B,GAA8C,EAC9C,GAAiB,EACjB,IAA6B;IAE7B,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACtD,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,CAAC;QACrE,iBAAiB,EAAE,IAA+B;KACnD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Reusable, product- and surface-agnostic tool contract.
|
|
2
|
+
//
|
|
3
|
+
// A ToolDef is the single source of truth for one tool. Thin adapters emit a
|
|
4
|
+
// concrete surface from it: an MCP server tool (./mcp.ts, used by this repo) or
|
|
5
|
+
// a WebMCP in-page tool (browser build). Nothing here imports the MCP SDK or
|
|
6
|
+
// touches the DOM, so the same definitions can be reused across products.
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/tool-kit/types.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,EAAE;AACF,6EAA6E;AAC7E,gFAAgF;AAChF,6EAA6E;AAC7E,0EAA0E"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export const analyzeAwardPatternsDef = {
|
|
2
|
+
name: "analyze_award_patterns",
|
|
3
|
+
description: "Analyze how contracts in a NAICS are typically awarded: award-size distribution, competition mix " +
|
|
4
|
+
"(full & open / limited / sole-source), bid intensity (single-bid rate, expected bidders), contract " +
|
|
5
|
+
"vehicles, and pricing types. From public USAspending + FPDS data. Costs 3 credits.",
|
|
6
|
+
inputSchema: {
|
|
7
|
+
type: "object",
|
|
8
|
+
properties: {
|
|
9
|
+
naicsCode: { type: "string", description: "NAICS code (required)." },
|
|
10
|
+
pscCode: { type: "string", description: "Optional PSC code to narrow the analysis." },
|
|
11
|
+
years: { type: "number", description: "Lookback in years (default ~3)." },
|
|
12
|
+
state: { type: "string", description: "Optional 2-letter place-of-performance state filter." },
|
|
13
|
+
},
|
|
14
|
+
required: ["naicsCode"],
|
|
15
|
+
additionalProperties: false,
|
|
16
|
+
},
|
|
17
|
+
outputSchema: {
|
|
18
|
+
type: "object",
|
|
19
|
+
properties: {
|
|
20
|
+
awardSizeDistribution: { type: "array", items: { type: "object", additionalProperties: true } },
|
|
21
|
+
competition: { type: ["object", "null"], additionalProperties: true },
|
|
22
|
+
bidStatistics: { type: ["object", "null"], additionalProperties: true },
|
|
23
|
+
contractVehicles: { type: "array", items: { type: "object", additionalProperties: true } },
|
|
24
|
+
pricingTypes: { type: "array", items: { type: "object", additionalProperties: true } },
|
|
25
|
+
},
|
|
26
|
+
additionalProperties: true,
|
|
27
|
+
},
|
|
28
|
+
annotations: {
|
|
29
|
+
title: "Analyze award patterns",
|
|
30
|
+
readOnlyHint: true,
|
|
31
|
+
destructiveHint: false,
|
|
32
|
+
idempotentHint: true,
|
|
33
|
+
openWorldHint: true,
|
|
34
|
+
},
|
|
35
|
+
async run(ctx, args) {
|
|
36
|
+
const naicsCode = typeof args.naicsCode === "string" ? args.naicsCode.trim() : "";
|
|
37
|
+
if (!naicsCode)
|
|
38
|
+
throw new Error("naicsCode is required");
|
|
39
|
+
const body = { naicsCode };
|
|
40
|
+
for (const k of ["pscCode", "years", "state"]) {
|
|
41
|
+
if (args[k] !== undefined)
|
|
42
|
+
body[k] = args[k];
|
|
43
|
+
}
|
|
44
|
+
return ctx.post("/analyze-award-patterns", body);
|
|
45
|
+
},
|
|
46
|
+
toText(data, disclaimer, args) {
|
|
47
|
+
const naicsCode = typeof args.naicsCode === "string" ? args.naicsCode.trim() : "";
|
|
48
|
+
const c = data.competition;
|
|
49
|
+
const b = data.bidStatistics;
|
|
50
|
+
const lines = [
|
|
51
|
+
`Award patterns for NAICS ${naicsCode}:`,
|
|
52
|
+
c
|
|
53
|
+
? `Competition: ${c.fullAndOpenPct ?? "?"}% full & open, ${c.soleSourcePct ?? "?"}% sole-source (${c.competitionLevel ?? "n/a"})`
|
|
54
|
+
: "Competition: (FPDS unavailable)",
|
|
55
|
+
b
|
|
56
|
+
? `Bidding: avg ${b.avgOffers ?? "?"} offers, ${b.singleBidRate ?? "?"}% single-bid, ~${b.expectedBidders ?? "?"} expected bidders`
|
|
57
|
+
: "Bidding: (FPDS unavailable)",
|
|
58
|
+
data.pricingTypes && data.pricingTypes.length
|
|
59
|
+
? `Pricing: ${data.pricingTypes.map((p) => `${p.type} ${p.pct}%`).join(", ")}`
|
|
60
|
+
: null,
|
|
61
|
+
data.contractVehicles && data.contractVehicles.length
|
|
62
|
+
? `Vehicles: ${data.contractVehicles.slice(0, 5).map((v) => `${v.vehicle} ${v.pct}%`).join(", ")}`
|
|
63
|
+
: null,
|
|
64
|
+
data.awardSizeDistribution && data.awardSizeDistribution.length
|
|
65
|
+
? `Award sizes: ${data.awardSizeDistribution.map((d) => `${d.range} ${d.pct}%`).join(", ")}`
|
|
66
|
+
: null,
|
|
67
|
+
disclaimer ? `\n${disclaimer}` : null,
|
|
68
|
+
].filter((s) => s !== null);
|
|
69
|
+
return lines.join("\n");
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=analyzeAwardPatterns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyzeAwardPatterns.js","sourceRoot":"","sources":["../../src/tools/analyzeAwardPatterns.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,uBAAuB,GAA4D;IAC9F,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EACT,mGAAmG;QACnG,qGAAqG;QACrG,oFAAoF;IACtF,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wBAAwB,EAAE;YACpE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,2CAA2C,EAAE;YACrF,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,iCAAiC,EAAE;YACzE,KAAK,EAAE,EA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GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;gBAC9E,CAAC,CAAC,IAAI;YACR,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,gBAAgB,CAAC,MAAM;gBACnD,CAAC,CAAC,aAAa,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;gBAClG,CAAC,CAAC,IAAI;YACR,IAAI,CAAC,qBAAqB,IAAI,IAAI,CAAC,qBAAqB,CAAC,MAAM;gBAC7D,CAAC,CAAC,gBAAgB,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;gBAC5F,CAAC,CAAC,IAAI;YACR,UAAU,CAAC,CAAC,CAAC,KAAK,UAAU,EAAE,CAAC,CAAC,CAAC,IAAI;SACtC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC;QACzC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
export const analyzeMarketDef = {
|
|
2
|
+
name: "analyze_market",
|
|
3
|
+
description: "Full market-intelligence snapshot for a NAICS: 5-year federal spending trend, industry size (Census), " +
|
|
4
|
+
"top contractors with market share + HHI concentration, set-aside distribution, geographic distribution, " +
|
|
5
|
+
"and contract-vehicle usage. From public USAspending + Census data. Costs 5 credits.",
|
|
6
|
+
inputSchema: {
|
|
7
|
+
type: "object",
|
|
8
|
+
properties: {
|
|
9
|
+
naicsCode: { type: "string", description: "NAICS code (required)." },
|
|
10
|
+
pscCode: { type: "string", description: "Optional PSC code for sharper competitor filtering." },
|
|
11
|
+
setAside: { type: "string", description: "Optional set-aside context." },
|
|
12
|
+
},
|
|
13
|
+
required: ["naicsCode"],
|
|
14
|
+
additionalProperties: false,
|
|
15
|
+
},
|
|
16
|
+
outputSchema: {
|
|
17
|
+
type: "object",
|
|
18
|
+
properties: {
|
|
19
|
+
spendingTrend: { type: "array", items: { type: "object", additionalProperties: true } },
|
|
20
|
+
industryContext: { type: ["object", "null"], additionalProperties: true },
|
|
21
|
+
federalSharePct: { type: ["number", "null"] },
|
|
22
|
+
topContractors: { type: "array", items: { type: "object", additionalProperties: true } },
|
|
23
|
+
concentration: { type: ["object", "null"], additionalProperties: true },
|
|
24
|
+
setAsideDistribution: { type: "array", items: { type: "object", additionalProperties: true } },
|
|
25
|
+
geographicDistribution: { type: "array", items: { type: "object", additionalProperties: true } },
|
|
26
|
+
contractVehicles: { type: "array", items: { type: "object", additionalProperties: true } },
|
|
27
|
+
recentLargeAwards: { type: "array", items: { type: "object", additionalProperties: true } },
|
|
28
|
+
},
|
|
29
|
+
additionalProperties: true,
|
|
30
|
+
},
|
|
31
|
+
annotations: {
|
|
32
|
+
title: "Analyze market",
|
|
33
|
+
readOnlyHint: true,
|
|
34
|
+
destructiveHint: false,
|
|
35
|
+
idempotentHint: true,
|
|
36
|
+
openWorldHint: true,
|
|
37
|
+
},
|
|
38
|
+
async run(ctx, args) {
|
|
39
|
+
const naicsCode = typeof args.naicsCode === "string" ? args.naicsCode.trim() : "";
|
|
40
|
+
if (!naicsCode)
|
|
41
|
+
throw new Error("naicsCode is required");
|
|
42
|
+
const body = { naicsCode };
|
|
43
|
+
for (const k of ["pscCode", "setAside"]) {
|
|
44
|
+
if (args[k] !== undefined)
|
|
45
|
+
body[k] = args[k];
|
|
46
|
+
}
|
|
47
|
+
return ctx.post("/analyze-market", body);
|
|
48
|
+
},
|
|
49
|
+
toText(data, disclaimer, args) {
|
|
50
|
+
const naicsCode = typeof args.naicsCode === "string" ? args.naicsCode.trim() : "";
|
|
51
|
+
const trend = data.spendingTrend ?? [];
|
|
52
|
+
const conc = data.concentration;
|
|
53
|
+
const lines = [
|
|
54
|
+
`Market snapshot for NAICS ${naicsCode}:`,
|
|
55
|
+
trend.length
|
|
56
|
+
? `Spending: ${trend.map((t) => `FY${t.fiscalYear} $${(t.total / 1e9).toFixed(1)}B${t.inProgress ? " (YTD)" : ""}`).join(" → ")}`
|
|
57
|
+
: null,
|
|
58
|
+
data.topContractors && data.topContractors.length
|
|
59
|
+
? `Top contractors:\n${data.topContractors
|
|
60
|
+
.slice(0, 5)
|
|
61
|
+
.map((c, i) => ` ${i + 1}. ${c.name}${c.marketSharePct != null ? ` (${c.marketSharePct}%)` : ""}`)
|
|
62
|
+
.join("\n")}`
|
|
63
|
+
: null,
|
|
64
|
+
conc ? `Concentration: HHI ${conc.hhi ?? "?"} (${conc.level ?? "n/a"}), top-5 ${conc.top5SharePct ?? "?"}%` : null,
|
|
65
|
+
data.setAsideDistribution && data.setAsideDistribution.length
|
|
66
|
+
? `Set-asides: ${data.setAsideDistribution.slice(0, 4).map((s) => `${s.type} ${s.pct}%`).join(", ")}`
|
|
67
|
+
: null,
|
|
68
|
+
data.geographicDistribution && data.geographicDistribution.length
|
|
69
|
+
? `Top states: ${data.geographicDistribution.slice(0, 5).map((g) => g.state).join(", ")}`
|
|
70
|
+
: null,
|
|
71
|
+
data.industryContext && data.industryContext.establishments
|
|
72
|
+
? `Industry (Census): ${data.industryContext.establishments?.toLocaleString()} establishments, ${data.industryContext.employees?.toLocaleString()} employees`
|
|
73
|
+
: null,
|
|
74
|
+
disclaimer ? `\n${disclaimer}` : null,
|
|
75
|
+
].filter((s) => s !== null);
|
|
76
|
+
return lines.join("\n");
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=analyzeMarket.js.map
|
|
@@ -0,0 +1 @@
|
|
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"balance",
|
|
3
3
|
description: "Return the current GovToolsPro credit balance and subscription status for the authenticated account. " +
|
|
4
4
|
"Free — exercises auth end-to-end. The extension and the API draw from the same shared credit pool.",
|
|
@@ -30,22 +30,21 @@ export const balanceTool = {
|
|
|
30
30
|
idempotentHint: true,
|
|
31
31
|
openWorldHint: true,
|
|
32
32
|
},
|
|
33
|
+
async run(ctx) {
|
|
34
|
+
return ctx.get("/balance");
|
|
35
|
+
},
|
|
36
|
+
toText(data, disclaimer) {
|
|
37
|
+
const lines = [
|
|
38
|
+
`Credit balance: ${data.balance}`,
|
|
39
|
+
data.subscriptionCredits !== undefined ? ` • Subscription credits: ${data.subscriptionCredits}` : null,
|
|
40
|
+
data.topupCredits !== undefined ? ` • Top-up credits: ${data.topupCredits}` : null,
|
|
41
|
+
data.totalUsed !== undefined ? `Total used: ${data.totalUsed}` : null,
|
|
42
|
+
data.subscription
|
|
43
|
+
? `Subscription: ${data.subscription.planId ?? "unknown"} (${data.subscription.status ?? "unknown"})`
|
|
44
|
+
: "Subscription: none",
|
|
45
|
+
disclaimer ? `\n${disclaimer}` : null,
|
|
46
|
+
].filter((s) => s !== null);
|
|
47
|
+
return lines.join("\n");
|
|
48
|
+
},
|
|
33
49
|
};
|
|
34
|
-
export async function runBalance(api) {
|
|
35
|
-
const { data, disclaimer } = await api.get("/balance");
|
|
36
|
-
const lines = [
|
|
37
|
-
`Credit balance: ${data.balance}`,
|
|
38
|
-
data.subscriptionCredits !== undefined ? ` • Subscription credits: ${data.subscriptionCredits}` : null,
|
|
39
|
-
data.topupCredits !== undefined ? ` • Top-up credits: ${data.topupCredits}` : null,
|
|
40
|
-
data.totalUsed !== undefined ? `Total used: ${data.totalUsed}` : null,
|
|
41
|
-
data.subscription
|
|
42
|
-
? `Subscription: ${data.subscription.planId ?? "unknown"} (${data.subscription.status ?? "unknown"})`
|
|
43
|
-
: "Subscription: none",
|
|
44
|
-
disclaimer ? `\n${disclaimer}` : null,
|
|
45
|
-
].filter((s) => s !== null);
|
|
46
|
-
return {
|
|
47
|
-
content: [{ type: "text", text: lines.join("\n") }],
|
|
48
|
-
structuredContent: data,
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
50
|
//# sourceMappingURL=balance.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"balance.js","sourceRoot":"","sources":["../../src/tools/balance.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"balance.js","sourceRoot":"","sources":["../../src/tools/balance.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,UAAU,GAAsD;IAC3E,IAAI,EAAE,SAAS;IACf,WAAW,EACT,uGAAuG;QACvG,oGAAoG;IACtG,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,EAAE;QACd,oBAAoB,EAAE,KAAK;KAC5B;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,+BAA+B,EAAE;YACzE,mBAAmB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uCAAuC,EAAE;YAC7F,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uCAAuC,EAAE;YACtF,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,4BAA4B,EAAE;YACxE,cAAc,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6BAA6B,EAAE;YAC9E,YAAY,EAAE;gBACZ,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC;gBACxB,WAAW,EAAE,uCAAuC;gBACpD,UAAU,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;aACvE;SACF;QACD,QAAQ,EAAE,CAAC,SAAS,CAAC;KACtB;IACD,WAAW,EAAE;QACX,KAAK,EAAE,gBAAgB;QACvB,YAAY,EAAE,IAAI;QAClB,eAAe,EAAE,KAAK;QACtB,cAAc,EAAE,IAAI;QACpB,aAAa,EAAE,IAAI;KACpB;IAED,KAAK,CAAC,GAAG,CAAC,GAAiB;QACzB,OAAO,GAAG,CAAC,GAAG,CAAkB,UAAU,CAAC,CAAC;IAC9C,CAAC;IAED,MAAM,CAAC,IAAI,EAAE,UAAU;QACrB,MAAM,KAAK,GAAG;YACZ,mBAAmB,IAAI,CAAC,OAAO,EAAE;YACjC,IAAI,CAAC,mBAAmB,KAAK,SAAS,CAAC,CAAC,CAAC,6BAA6B,IAAI,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC,IAAI;YACvG,IAAI,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,uBAAuB,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,IAAI;YACnF,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,eAAe,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,IAAI;YACrE,IAAI,CAAC,YAAY;gBACf,CAAC,CAAC,iBAAiB,IAAI,CAAC,YAAY,CAAC,MAAM,IAAI,SAAS,KAAK,IAAI,CAAC,YAAY,CAAC,MAAM,IAAI,SAAS,GAAG;gBACrG,CAAC,CAAC,oBAAoB;YACxB,UAAU,CAAC,CAAC,CAAC,KAAK,UAAU,EAAE,CAAC,CAAC,CAAC,IAAI;SACtC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC;QACzC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CACF,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const
|
|
1
|
+
export const findIncumbentsDef = {
|
|
2
2
|
name: "find_incumbents",
|
|
3
3
|
description: "Identify the likely current incumbent(s) for a solicitation using public USAspending + FPDS award data. " +
|
|
4
4
|
"Returns the primary incumbent (name, award value, period of performance), FPDS competition signals " +
|
|
@@ -72,36 +72,35 @@ export const findIncumbentsTool = {
|
|
|
72
72
|
idempotentHint: true,
|
|
73
73
|
openWorldHint: true,
|
|
74
74
|
},
|
|
75
|
+
async run(ctx, args) {
|
|
76
|
+
const solicitation = args.solicitation;
|
|
77
|
+
if (!solicitation || typeof solicitation !== "object") {
|
|
78
|
+
throw new Error("solicitation (object) is required");
|
|
79
|
+
}
|
|
80
|
+
if (!solicitation.naicsCode) {
|
|
81
|
+
throw new Error("solicitation.naicsCode is required");
|
|
82
|
+
}
|
|
83
|
+
const body = { solicitation };
|
|
84
|
+
for (const k of ["years", "limit", "fpdsMaxResults", "anticipatedStartDate"]) {
|
|
85
|
+
if (args[k] !== undefined)
|
|
86
|
+
body[k] = args[k];
|
|
87
|
+
}
|
|
88
|
+
return ctx.post("/find-incumbents", body);
|
|
89
|
+
},
|
|
90
|
+
toText(data, disclaimer) {
|
|
91
|
+
const p = data.primaryIncumbent;
|
|
92
|
+
const lines = [
|
|
93
|
+
p
|
|
94
|
+
? `Primary incumbent: ${p.companyName ?? "unknown"}${p.totalValue ? ` — $${Number(p.totalValue).toLocaleString()}` : ""}${p.contractCount ? ` across ${p.contractCount} contract(s)` : ""}`
|
|
95
|
+
: "Primary incumbent: none identified",
|
|
96
|
+
p?.fpdsData
|
|
97
|
+
? ` FPDS signals: ${p.fpdsData.numberOfOffersReceived ?? "?"} offer(s) received${p.fpdsData.typeOfSetAside ? `, set-aside ${p.fpdsData.typeOfSetAside}` : ""}`
|
|
98
|
+
: null,
|
|
99
|
+
data.anticipatedStartDate ? `Anticipated next-award start: ${data.anticipatedStartDate}` : null,
|
|
100
|
+
`Sources: USAspending ${data.usaspendingResults ?? 0} result(s), FPDS ${data.fpdsResults ?? 0} result(s)${data.fpdsError ? ` (FPDS degraded: ${data.fpdsError})` : ""}`,
|
|
101
|
+
disclaimer ? `\n${disclaimer}` : null,
|
|
102
|
+
].filter((s) => s !== null);
|
|
103
|
+
return lines.join("\n");
|
|
104
|
+
},
|
|
75
105
|
};
|
|
76
|
-
export async function runFindIncumbents(api, args) {
|
|
77
|
-
const solicitation = args.solicitation;
|
|
78
|
-
if (!solicitation || typeof solicitation !== "object") {
|
|
79
|
-
throw new Error("solicitation (object) is required");
|
|
80
|
-
}
|
|
81
|
-
if (!solicitation.naicsCode) {
|
|
82
|
-
throw new Error("solicitation.naicsCode is required");
|
|
83
|
-
}
|
|
84
|
-
const body = { solicitation };
|
|
85
|
-
for (const k of ["years", "limit", "fpdsMaxResults", "anticipatedStartDate"]) {
|
|
86
|
-
if (args[k] !== undefined)
|
|
87
|
-
body[k] = args[k];
|
|
88
|
-
}
|
|
89
|
-
const { data, disclaimer } = await api.post("/find-incumbents", body);
|
|
90
|
-
const p = data.primaryIncumbent;
|
|
91
|
-
const lines = [
|
|
92
|
-
p
|
|
93
|
-
? `Primary incumbent: ${p.companyName ?? "unknown"}${p.totalValue ? ` — $${Number(p.totalValue).toLocaleString()}` : ""}${p.contractCount ? ` across ${p.contractCount} contract(s)` : ""}`
|
|
94
|
-
: "Primary incumbent: none identified",
|
|
95
|
-
p?.fpdsData
|
|
96
|
-
? ` FPDS signals: ${p.fpdsData.numberOfOffersReceived ?? "?"} offer(s) received${p.fpdsData.typeOfSetAside ? `, set-aside ${p.fpdsData.typeOfSetAside}` : ""}`
|
|
97
|
-
: null,
|
|
98
|
-
data.anticipatedStartDate ? `Anticipated next-award start: ${data.anticipatedStartDate}` : null,
|
|
99
|
-
`Sources: USAspending ${data.usaspendingResults ?? 0} result(s), FPDS ${data.fpdsResults ?? 0} result(s)${data.fpdsError ? ` (FPDS degraded: ${data.fpdsError})` : ""}`,
|
|
100
|
-
disclaimer ? `\n${disclaimer}` : null,
|
|
101
|
-
].filter((s) => s !== null);
|
|
102
|
-
return {
|
|
103
|
-
content: [{ type: "text", text: lines.join("\n") }],
|
|
104
|
-
structuredContent: data,
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
106
|
//# sourceMappingURL=findIncumbents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findIncumbents.js","sourceRoot":"","sources":["../../src/tools/findIncumbents.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"findIncumbents.js","sourceRoot":"","sources":["../../src/tools/findIncumbents.ts"],"names":[],"mappings":"AAiBA,MAAM,CAAC,MAAM,iBAAiB,GAAwD;IACpF,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACT,0GAA0G;QAC1G,qGAAqG;QACrG,6FAA6F;QAC7F,wFAAwF;IAC1F,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,YAAY,EAAE;gBACZ,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,yIAAyI;gBAC3I,UAAU,EAAE;oBACV,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wBAAwB,EAAE;oBACpE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBAC3B,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBAC1B,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBAC7B,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBAC1B,kBAAkB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACtC,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACzB,gBAAgB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;iBACrC;gBACD,QAAQ,EAAE,CAAC,WAAW,CAAC;aACxB;YACD,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,2DAA2D,EAAE;YACnG,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kDAAkD,EAAE;YAC1F,cAAc,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,W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AoC;YACxC,CAAC,EAAE,QAAQ;gBACT,CAAC,CAAC,mBAAmB,CAAC,CAAC,QAAQ,CAAC,sBAAsB,IAAI,GAAG,qBAAqB,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE;gBAC/J,CAAC,CAAC,IAAI;YACR,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,iCAAiC,IAAI,CAAC,oBAAoB,EAAE,CAAC,CAAC,CAAC,IAAI;YAC/F,wBAAwB,IAAI,CAAC,kBAAkB,IAAI,CAAC,oBAAoB,IAAI,CAAC,WAAW,IAAI,CAAC,aAAa,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,oBAAoB,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YACvK,UAAU,CAAC,CAAC,CAAC,KAAK,UAAU,EAAE,CAAC,CAAC,CAAC,IAAI;SACtC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC;QACzC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CACF,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const
|
|
1
|
+
export const findPartnersNearDef = {
|
|
2
2
|
name: "find_partners_near",
|
|
3
3
|
description: "Find potential teaming partners / subcontractors near a solicitation's place of performance via Google Places. " +
|
|
4
4
|
"Given a capability keyword and a geocodable address, returns nearby businesses ranked by proximity, " +
|
|
@@ -62,32 +62,33 @@ export const findPartnersNearTool = {
|
|
|
62
62
|
idempotentHint: true,
|
|
63
63
|
openWorldHint: true,
|
|
64
64
|
},
|
|
65
|
+
async run(ctx, args) {
|
|
66
|
+
const keyword = typeof args.keyword === "string" ? args.keyword : "";
|
|
67
|
+
const address = typeof args.address === "string" ? args.address : "";
|
|
68
|
+
if (!keyword)
|
|
69
|
+
throw new Error("keyword is required");
|
|
70
|
+
if (!address)
|
|
71
|
+
throw new Error("address is required");
|
|
72
|
+
const body = { keyword, address };
|
|
73
|
+
if (typeof args.radius === "number")
|
|
74
|
+
body.radius = args.radius;
|
|
75
|
+
return ctx.post("/find-partners-near", body);
|
|
76
|
+
},
|
|
77
|
+
toText(data, disclaimer, args) {
|
|
78
|
+
const keyword = typeof args.keyword === "string" ? args.keyword : "";
|
|
79
|
+
const address = typeof args.address === "string" ? args.address : "";
|
|
80
|
+
const lines = [
|
|
81
|
+
`${data.totalResults} partner candidate(s) for "${keyword}" near ${address}:`,
|
|
82
|
+
...data.businesses.slice(0, 10).map((b, i) => {
|
|
83
|
+
const dist = b.distanceMiles !== undefined ? `${b.distanceMiles.toFixed(1)} mi` : "?";
|
|
84
|
+
const rating = b.rating !== undefined ? `★${b.rating}` : "";
|
|
85
|
+
const contact = [b.phone, b.website].filter(Boolean).join(" · ");
|
|
86
|
+
return ` ${i + 1}. ${b.name ?? "n/a"} (${dist}) ${rating}\n ${b.formattedAddress ?? ""}${contact ? `\n ${contact}` : ""}`;
|
|
87
|
+
}),
|
|
88
|
+
data.businesses.length > 10 ? ` … and ${data.businesses.length - 10} more in structuredContent.businesses` : null,
|
|
89
|
+
disclaimer ? `\n${disclaimer}` : null,
|
|
90
|
+
].filter((s) => s !== null);
|
|
91
|
+
return lines.join("\n");
|
|
92
|
+
},
|
|
65
93
|
};
|
|
66
|
-
export async function runFindPartnersNear(api, args) {
|
|
67
|
-
const keyword = typeof args.keyword === "string" ? args.keyword : "";
|
|
68
|
-
const address = typeof args.address === "string" ? args.address : "";
|
|
69
|
-
if (!keyword)
|
|
70
|
-
throw new Error("keyword is required");
|
|
71
|
-
if (!address)
|
|
72
|
-
throw new Error("address is required");
|
|
73
|
-
const body = { keyword, address };
|
|
74
|
-
if (typeof args.radius === "number")
|
|
75
|
-
body.radius = args.radius;
|
|
76
|
-
const { data, disclaimer } = await api.post("/find-partners-near", body);
|
|
77
|
-
const lines = [
|
|
78
|
-
`${data.totalResults} partner candidate(s) for "${keyword}" near ${address}:`,
|
|
79
|
-
...data.businesses.slice(0, 10).map((b, i) => {
|
|
80
|
-
const dist = b.distanceMiles !== undefined ? `${b.distanceMiles.toFixed(1)} mi` : "?";
|
|
81
|
-
const rating = b.rating !== undefined ? `★${b.rating}` : "";
|
|
82
|
-
const contact = [b.phone, b.website].filter(Boolean).join(" · ");
|
|
83
|
-
return ` ${i + 1}. ${b.name ?? "n/a"} (${dist}) ${rating}\n ${b.formattedAddress ?? ""}${contact ? `\n ${contact}` : ""}`;
|
|
84
|
-
}),
|
|
85
|
-
data.businesses.length > 10 ? ` … and ${data.businesses.length - 10} more in structuredContent.businesses` : null,
|
|
86
|
-
disclaimer ? `\n${disclaimer}` : null,
|
|
87
|
-
].filter((s) => s !== null);
|
|
88
|
-
return {
|
|
89
|
-
content: [{ type: "text", text: lines.join("\n") }],
|
|
90
|
-
structuredContent: data,
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
94
|
//# sourceMappingURL=findPartnersNear.js.map
|