mcp-google-ads 1.0.13 → 1.0.14
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/LICENSE +1 -1
- package/README.md +2 -0
- package/dist/build-info.json +1 -1
- package/dist/index.js +3 -1
- package/dist/resilience.js +4 -0
- package/package.json +1 -1
package/LICENSE
CHANGED
package/README.md
CHANGED
package/dist/build-info.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"sha":"
|
|
1
|
+
{"sha":"1c7a8b2","builtAt":"2026-04-09T23:02:14.294Z"}
|
package/dist/index.js
CHANGED
|
@@ -1759,11 +1759,13 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
1759
1759
|
else {
|
|
1760
1760
|
response.details = rawError.errors || rawError.stack;
|
|
1761
1761
|
}
|
|
1762
|
+
// Size-limit error responses through safeResponse to prevent oversized payloads
|
|
1763
|
+
const safeErrorResponse = safeResponse(response, "error");
|
|
1762
1764
|
return {
|
|
1763
1765
|
isError: true,
|
|
1764
1766
|
content: [{
|
|
1765
1767
|
type: "text",
|
|
1766
|
-
text: JSON.stringify(
|
|
1768
|
+
text: JSON.stringify(safeErrorResponse, null, 2),
|
|
1767
1769
|
}],
|
|
1768
1770
|
};
|
|
1769
1771
|
}
|
package/dist/resilience.js
CHANGED
|
@@ -31,6 +31,10 @@ export function safeResponse(data, context) {
|
|
|
31
31
|
const sizeBytes = Buffer.byteLength(jsonStr, "utf-8");
|
|
32
32
|
if (sizeBytes <= MAX_RESPONSE_SIZE)
|
|
33
33
|
return current;
|
|
34
|
+
// Deep clone on first truncation pass to avoid mutating the original object
|
|
35
|
+
if (pass === 0 && typeof current === "object" && current !== null) {
|
|
36
|
+
current = JSON.parse(JSON.stringify(current));
|
|
37
|
+
}
|
|
34
38
|
logger.warn({ sizeBytes, maxSize: MAX_RESPONSE_SIZE, context, pass }, "Response exceeds size limit, truncating");
|
|
35
39
|
if (Array.isArray(current)) {
|
|
36
40
|
current = current.slice(0, Math.max(1, Math.floor(current.length * 0.5)));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-google-ads",
|
|
3
3
|
"mcpName": "io.github.mharnett/google-ads",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.14",
|
|
5
5
|
"description": "MCP server for Google Ads API with MCC support, 34 tools for campaign management, reporting, and optimization. Safe by default -- all changes created PAUSED.",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"bin": {
|