debreu-mcp-admin 3.186.0 → 3.188.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/dist/index.js +14 -6
- package/dist/index.js.map +1 -1
- package/dist/transactionTools.d.ts +457 -0
- package/dist/transactionTools.js +144 -0
- package/dist/transactionTools.js.map +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import path from "node:path";
|
|
|
4
4
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
5
5
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
6
6
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
7
|
+
import { TRANSACTION_TOOLS, TRANSACTION_TOOL_NAMES } from "./transactionTools.js";
|
|
7
8
|
// <generated:deal-term-props>
|
|
8
9
|
// Generated from backend/app/services/project_deal_terms.py by
|
|
9
10
|
// scripts/gen_mcp_deal_term_props.py -- edit the field guide there, then re-run.
|
|
@@ -209,6 +210,10 @@ const OUTREACH_TOOL_NAMES = new Set([
|
|
|
209
210
|
"get_email_outreach_sequence",
|
|
210
211
|
"stop_email_outreach_sequence",
|
|
211
212
|
]);
|
|
213
|
+
/** Write tools whose 4xx detail is shown to the caller, like the outreach tools:
|
|
214
|
+
* their 400s explain a bad argument ("period_label 'last summer' is not a
|
|
215
|
+
* period: use YYYY, ...") that the model can fix and retry. */
|
|
216
|
+
const CLIENT_ERROR_TOOL_NAMES = new Set(["update_company", "update_project", ...TRANSACTION_TOOL_NAMES]);
|
|
212
217
|
/** "HTTP 4xx: <detail>" from an ``HTTP 4xx: <body>`` error, or null. FastAPI
|
|
213
218
|
* bodies are ``{"detail": "..."}``, or a validation list on 422. */
|
|
214
219
|
function clientErrorMessage(msg) {
|
|
@@ -2884,7 +2889,7 @@ const USER_TOOLS = [
|
|
|
2884
2889
|
description: "Delete a record by type and UUID. Supported types: company, person, task, " +
|
|
2885
2890
|
"metric_schema, project, comment, status_definition, email, calendar, file, " +
|
|
2886
2891
|
"port_co_relationship, fund, email_template, biopharma_asset, biopharma_indication, " +
|
|
2887
|
-
"email_campaign (an outreach), workflow. " +
|
|
2892
|
+
"email_campaign (an outreach), workflow, transaction. " +
|
|
2888
2893
|
"Performs soft delete (email/calendar/file use the same cascade behavior as app deletes). " +
|
|
2889
2894
|
"For workflow, removes a tracker from a project — cascades its views and tracked " +
|
|
2890
2895
|
"companies/people; tasks keep their rows with workflow_id cleared. Add a tracker with add_tracker. " +
|
|
@@ -2926,6 +2931,7 @@ const USER_TOOLS = [
|
|
|
2926
2931
|
"biopharma_indication",
|
|
2927
2932
|
"email_campaign",
|
|
2928
2933
|
"workflow",
|
|
2934
|
+
"transaction",
|
|
2929
2935
|
],
|
|
2930
2936
|
description: "Type of record to delete.",
|
|
2931
2937
|
},
|
|
@@ -4016,7 +4022,7 @@ const ADMIN_TOOLS = [
|
|
|
4016
4022
|
},
|
|
4017
4023
|
];
|
|
4018
4024
|
// All tools combined
|
|
4019
|
-
const TOOLS = [...USER_TOOLS, ...ADMIN_TOOLS];
|
|
4025
|
+
const TOOLS = [...USER_TOOLS, ...TRANSACTION_TOOLS, ...ADMIN_TOOLS];
|
|
4020
4026
|
// ---------------------------------------------------------------------------
|
|
4021
4027
|
// User-facing tool handler body key constants
|
|
4022
4028
|
// ---------------------------------------------------------------------------
|
|
@@ -4071,8 +4077,8 @@ function extractActAsUser(args) {
|
|
|
4071
4077
|
}
|
|
4072
4078
|
async function handleUserTool(name, args) {
|
|
4073
4079
|
const { actAsUser, cleanArgs } = extractActAsUser(args);
|
|
4074
|
-
// Read tools all route through /api/v1/ext/tools/{slug}
|
|
4075
|
-
if (USER_READ_TOOL_NAMES.has(name)) {
|
|
4080
|
+
// Read tools and the Transactions tools all route through /api/v1/ext/tools/{slug}
|
|
4081
|
+
if (USER_READ_TOOL_NAMES.has(name) || TRANSACTION_TOOL_NAMES.has(name)) {
|
|
4076
4082
|
const slug = name.replace(/_/g, "-");
|
|
4077
4083
|
return textResult(await apiPost(`/api/v1/ext/tools/${slug}`, cleanArgs, undefined, actAsUser));
|
|
4078
4084
|
}
|
|
@@ -4737,10 +4743,12 @@ async function handleTool(name, args) {
|
|
|
4737
4743
|
const timeoutMsg = queryTimeoutMessage(msg);
|
|
4738
4744
|
if (timeoutMsg)
|
|
4739
4745
|
return errorResult(timeoutMsg);
|
|
4740
|
-
if (OUTREACH_TOOL_NAMES.has(name)) {
|
|
4746
|
+
if (OUTREACH_TOOL_NAMES.has(name) || CLIENT_ERROR_TOOL_NAMES.has(name)) {
|
|
4741
4747
|
const clientMsg = clientErrorMessage(msg);
|
|
4742
4748
|
if (clientMsg)
|
|
4743
4749
|
return errorResult(clientMsg);
|
|
4750
|
+
}
|
|
4751
|
+
if (OUTREACH_TOOL_NAMES.has(name)) {
|
|
4744
4752
|
// The handler's own argument checks ("action must be ...").
|
|
4745
4753
|
if (!/^HTTP \d{3}/.test(msg))
|
|
4746
4754
|
return errorResult(msg);
|
|
@@ -4777,7 +4785,7 @@ const DISABLED_TOOLS = new Set([
|
|
|
4777
4785
|
"create_biopharma_indication",
|
|
4778
4786
|
"update_biopharma_indication",
|
|
4779
4787
|
]);
|
|
4780
|
-
const server = new Server({ name: "debreu-mcp-admin", version: "3.
|
|
4788
|
+
const server = new Server({ name: "debreu-mcp-admin", version: "3.188.0" }, { capabilities: { tools: {} } });
|
|
4781
4789
|
// Metric-schema / status-definition EDIT tools, dropped from tools/list when the
|
|
4782
4790
|
// key owner has the `hide_configurations` flag (the same flag that hides the FE
|
|
4783
4791
|
// Configurations section). Reads stay listed — other tools depend on them.
|