fdic-mcp-server 1.1.1 → 1.1.3
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 +32 -20
- package/dist/server.js +32 -20
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ var import_streamableHttp = require("@modelcontextprotocol/sdk/server/streamable
|
|
|
30
30
|
var import_express = __toESM(require("express"));
|
|
31
31
|
|
|
32
32
|
// src/constants.ts
|
|
33
|
-
var VERSION = true ? "1.1.
|
|
33
|
+
var VERSION = true ? "1.1.3" : process.env.npm_package_version ?? "0.0.0-dev";
|
|
34
34
|
var FDIC_API_BASE_URL = "https://banks.data.fdic.gov/api";
|
|
35
35
|
var CHARACTER_LIMIT = 5e4;
|
|
36
36
|
var ENDPOINTS = {
|
|
@@ -1201,15 +1201,13 @@ var SnapshotAnalysisSchema = import_zod7.z.object({
|
|
|
1201
1201
|
"Comparison field used to rank institutions."
|
|
1202
1202
|
),
|
|
1203
1203
|
sort_order: import_zod7.z.enum(["ASC", "DESC"]).default("DESC").describe("Sort direction for the ranked comparisons.")
|
|
1204
|
-
})
|
|
1204
|
+
});
|
|
1205
|
+
function validateSnapshotAnalysisParams(value) {
|
|
1205
1206
|
if (!value.state && (!value.certs || value.certs.length === 0)) {
|
|
1206
|
-
|
|
1207
|
-
code: import_zod7.z.ZodIssueCode.custom,
|
|
1208
|
-
message: "Provide either state or certs.",
|
|
1209
|
-
path: ["state"]
|
|
1210
|
-
});
|
|
1207
|
+
return "Provide either state or certs.";
|
|
1211
1208
|
}
|
|
1212
|
-
|
|
1209
|
+
return null;
|
|
1210
|
+
}
|
|
1213
1211
|
function maxOrNull(values) {
|
|
1214
1212
|
const nonNullValues = values.filter((value) => value !== null);
|
|
1215
1213
|
return nonNullValues.length > 0 ? Math.max(...nonNullValues) : null;
|
|
@@ -1714,6 +1712,22 @@ Returns concise comparison text plus structured deltas, derived metrics, and ins
|
|
|
1714
1712
|
const controller = new AbortController();
|
|
1715
1713
|
const timeoutId = setTimeout(() => controller.abort(), ANALYSIS_TIMEOUT_MS);
|
|
1716
1714
|
try {
|
|
1715
|
+
const validationError = validateSnapshotAnalysisParams({
|
|
1716
|
+
state,
|
|
1717
|
+
certs,
|
|
1718
|
+
institution_filters,
|
|
1719
|
+
active_only,
|
|
1720
|
+
start_repdte,
|
|
1721
|
+
end_repdte,
|
|
1722
|
+
analysis_mode,
|
|
1723
|
+
include_demographics,
|
|
1724
|
+
limit,
|
|
1725
|
+
sort_by,
|
|
1726
|
+
sort_order
|
|
1727
|
+
});
|
|
1728
|
+
if (validationError) {
|
|
1729
|
+
return formatToolError(new Error(validationError));
|
|
1730
|
+
}
|
|
1717
1731
|
const rosterResult = certs && certs.length > 0 ? {
|
|
1718
1732
|
records: certs.map((cert) => ({ CERT: cert })),
|
|
1719
1733
|
warning: void 0
|
|
@@ -2043,22 +2057,16 @@ var PeerGroupInputSchema = import_zod8.z.object({
|
|
|
2043
2057
|
limit: import_zod8.z.number().int().min(1).max(500).default(50).describe(
|
|
2044
2058
|
"Max peer records returned in the response. All matched peers are used for ranking regardless of this limit."
|
|
2045
2059
|
)
|
|
2046
|
-
})
|
|
2060
|
+
});
|
|
2061
|
+
function validatePeerGroupParams(value) {
|
|
2047
2062
|
if (!value.cert && value.asset_min === void 0 && value.asset_max === void 0 && !value.charter_classes && !value.state && !value.raw_filter) {
|
|
2048
|
-
|
|
2049
|
-
code: import_zod8.z.ZodIssueCode.custom,
|
|
2050
|
-
message: "At least one peer-group constructor is required: cert, asset_min, asset_max, charter_classes, state, or raw_filter.",
|
|
2051
|
-
path: ["cert"]
|
|
2052
|
-
});
|
|
2063
|
+
return "At least one peer-group constructor is required: cert, asset_min, asset_max, charter_classes, state, or raw_filter.";
|
|
2053
2064
|
}
|
|
2054
2065
|
if (value.asset_min !== void 0 && value.asset_max !== void 0 && value.asset_min > value.asset_max) {
|
|
2055
|
-
|
|
2056
|
-
code: import_zod8.z.ZodIssueCode.custom,
|
|
2057
|
-
message: "asset_min must be <= asset_max.",
|
|
2058
|
-
path: ["asset_min"]
|
|
2059
|
-
});
|
|
2066
|
+
return "asset_min must be <= asset_max.";
|
|
2060
2067
|
}
|
|
2061
|
-
|
|
2068
|
+
return null;
|
|
2069
|
+
}
|
|
2062
2070
|
var FINANCIAL_FIELDS = "CERT,ASSET,DEP,NETINC,ROA,ROE,NETNIM,EQTOT,LNLSNET,INTINC,EINTEXP,NONII,NONIX";
|
|
2063
2071
|
function formatMetricValue(key, value) {
|
|
2064
2072
|
if (value === null) return "n/a";
|
|
@@ -2163,6 +2171,10 @@ Override precedence: cert derives defaults, then explicit params override them.`
|
|
|
2163
2171
|
const controller = new AbortController();
|
|
2164
2172
|
const timeoutId = setTimeout(() => controller.abort(), ANALYSIS_TIMEOUT_MS);
|
|
2165
2173
|
try {
|
|
2174
|
+
const validationError = validatePeerGroupParams(params);
|
|
2175
|
+
if (validationError) {
|
|
2176
|
+
return formatToolError(new Error(validationError));
|
|
2177
|
+
}
|
|
2166
2178
|
const warnings = [];
|
|
2167
2179
|
let subjectProfile = null;
|
|
2168
2180
|
let subjectFinancials = null;
|
package/dist/server.js
CHANGED
|
@@ -42,7 +42,7 @@ var import_streamableHttp = require("@modelcontextprotocol/sdk/server/streamable
|
|
|
42
42
|
var import_express = __toESM(require("express"));
|
|
43
43
|
|
|
44
44
|
// src/constants.ts
|
|
45
|
-
var VERSION = true ? "1.1.
|
|
45
|
+
var VERSION = true ? "1.1.3" : process.env.npm_package_version ?? "0.0.0-dev";
|
|
46
46
|
var FDIC_API_BASE_URL = "https://banks.data.fdic.gov/api";
|
|
47
47
|
var CHARACTER_LIMIT = 5e4;
|
|
48
48
|
var ENDPOINTS = {
|
|
@@ -1213,15 +1213,13 @@ var SnapshotAnalysisSchema = import_zod7.z.object({
|
|
|
1213
1213
|
"Comparison field used to rank institutions."
|
|
1214
1214
|
),
|
|
1215
1215
|
sort_order: import_zod7.z.enum(["ASC", "DESC"]).default("DESC").describe("Sort direction for the ranked comparisons.")
|
|
1216
|
-
})
|
|
1216
|
+
});
|
|
1217
|
+
function validateSnapshotAnalysisParams(value) {
|
|
1217
1218
|
if (!value.state && (!value.certs || value.certs.length === 0)) {
|
|
1218
|
-
|
|
1219
|
-
code: import_zod7.z.ZodIssueCode.custom,
|
|
1220
|
-
message: "Provide either state or certs.",
|
|
1221
|
-
path: ["state"]
|
|
1222
|
-
});
|
|
1219
|
+
return "Provide either state or certs.";
|
|
1223
1220
|
}
|
|
1224
|
-
|
|
1221
|
+
return null;
|
|
1222
|
+
}
|
|
1225
1223
|
function maxOrNull(values) {
|
|
1226
1224
|
const nonNullValues = values.filter((value) => value !== null);
|
|
1227
1225
|
return nonNullValues.length > 0 ? Math.max(...nonNullValues) : null;
|
|
@@ -1726,6 +1724,22 @@ Returns concise comparison text plus structured deltas, derived metrics, and ins
|
|
|
1726
1724
|
const controller = new AbortController();
|
|
1727
1725
|
const timeoutId = setTimeout(() => controller.abort(), ANALYSIS_TIMEOUT_MS);
|
|
1728
1726
|
try {
|
|
1727
|
+
const validationError = validateSnapshotAnalysisParams({
|
|
1728
|
+
state,
|
|
1729
|
+
certs,
|
|
1730
|
+
institution_filters,
|
|
1731
|
+
active_only,
|
|
1732
|
+
start_repdte,
|
|
1733
|
+
end_repdte,
|
|
1734
|
+
analysis_mode,
|
|
1735
|
+
include_demographics,
|
|
1736
|
+
limit,
|
|
1737
|
+
sort_by,
|
|
1738
|
+
sort_order
|
|
1739
|
+
});
|
|
1740
|
+
if (validationError) {
|
|
1741
|
+
return formatToolError(new Error(validationError));
|
|
1742
|
+
}
|
|
1729
1743
|
const rosterResult = certs && certs.length > 0 ? {
|
|
1730
1744
|
records: certs.map((cert) => ({ CERT: cert })),
|
|
1731
1745
|
warning: void 0
|
|
@@ -2055,22 +2069,16 @@ var PeerGroupInputSchema = import_zod8.z.object({
|
|
|
2055
2069
|
limit: import_zod8.z.number().int().min(1).max(500).default(50).describe(
|
|
2056
2070
|
"Max peer records returned in the response. All matched peers are used for ranking regardless of this limit."
|
|
2057
2071
|
)
|
|
2058
|
-
})
|
|
2072
|
+
});
|
|
2073
|
+
function validatePeerGroupParams(value) {
|
|
2059
2074
|
if (!value.cert && value.asset_min === void 0 && value.asset_max === void 0 && !value.charter_classes && !value.state && !value.raw_filter) {
|
|
2060
|
-
|
|
2061
|
-
code: import_zod8.z.ZodIssueCode.custom,
|
|
2062
|
-
message: "At least one peer-group constructor is required: cert, asset_min, asset_max, charter_classes, state, or raw_filter.",
|
|
2063
|
-
path: ["cert"]
|
|
2064
|
-
});
|
|
2075
|
+
return "At least one peer-group constructor is required: cert, asset_min, asset_max, charter_classes, state, or raw_filter.";
|
|
2065
2076
|
}
|
|
2066
2077
|
if (value.asset_min !== void 0 && value.asset_max !== void 0 && value.asset_min > value.asset_max) {
|
|
2067
|
-
|
|
2068
|
-
code: import_zod8.z.ZodIssueCode.custom,
|
|
2069
|
-
message: "asset_min must be <= asset_max.",
|
|
2070
|
-
path: ["asset_min"]
|
|
2071
|
-
});
|
|
2078
|
+
return "asset_min must be <= asset_max.";
|
|
2072
2079
|
}
|
|
2073
|
-
|
|
2080
|
+
return null;
|
|
2081
|
+
}
|
|
2074
2082
|
var FINANCIAL_FIELDS = "CERT,ASSET,DEP,NETINC,ROA,ROE,NETNIM,EQTOT,LNLSNET,INTINC,EINTEXP,NONII,NONIX";
|
|
2075
2083
|
function formatMetricValue(key, value) {
|
|
2076
2084
|
if (value === null) return "n/a";
|
|
@@ -2175,6 +2183,10 @@ Override precedence: cert derives defaults, then explicit params override them.`
|
|
|
2175
2183
|
const controller = new AbortController();
|
|
2176
2184
|
const timeoutId = setTimeout(() => controller.abort(), ANALYSIS_TIMEOUT_MS);
|
|
2177
2185
|
try {
|
|
2186
|
+
const validationError = validatePeerGroupParams(params);
|
|
2187
|
+
if (validationError) {
|
|
2188
|
+
return formatToolError(new Error(validationError));
|
|
2189
|
+
}
|
|
2178
2190
|
const warnings = [];
|
|
2179
2191
|
let subjectProfile = null;
|
|
2180
2192
|
let subjectFinancials = null;
|