koala73/worldmonitor · error · SafeWebMcpError
Tool output exceeded the safe output limit.
Error message
Tool output exceeded the safe output limit.
What it means
SafeWebMcpError thrown by enforceOutputBudget in the browser WebMCP tool layer when a tool result, once JSON-serialized, exceeds the maximum allowed output size. It is a hard safety cap after any graceful truncation: oversized results are refused rather than shipped, and the generic message deliberately avoids echoing untrusted tool content.
Source
Thrown at src/services/webmcp.ts:796
`Dashboard unavailable: ${boundedText(error.message, 160)} Reason: ${error.reason}.`,
'unavailable',
);
}
if (error instanceof DashboardPanelCatalogError) {
throw new SafeWebMcpError(error.message, 'validation');
}
if (error instanceof MissionPresetCatalogError) {
throw new SafeWebMcpError(error.message, 'validation');
}
throw new SafeWebMcpError(TOOL_FAILURE_MESSAGES[name]);
}
};
}
function enforceOutputBudget(value: unknown): void {
const serialized = JSON.stringify(value);
if (typeof serialized !== 'string' || serialized.length > MAX_OUTPUT_CHARS) {
throw new SafeWebMcpError('Tool output exceeded the safe output limit.');
}
}
function structuredResultReasons(result: Record<string, unknown>): string[] {
const reasons = typeof result.reason === 'string' ? [result.reason] : [];
if (!Array.isArray(result.targets)) return reasons;
for (const target of result.targets) {
if (target && typeof target === 'object' && 'reason' in target) {
const reason = (target as { reason?: unknown }).reason;
if (typeof reason === 'string') reasons.push(reason);
}
}
return reasons;
}
const VALIDATION_DENIAL_REASONS = new Set([
'malformed_arguments',
'invalid_action',View on GitHub (pinned to 9361220cc0)
Solutions
- Reduce the tool's requested scope/limit so the result fits the budget
- Apply tool-specific truncation before the global budget check
- Split large queries into narrower invocations
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/services/webmcp.ts:303 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of koala73/worldmonitor@9361220cc0 (2026-08-21).
Data as JSON: /api/errors/3304a668eded8040.
Report an issue: GitHub.