Improve MCP safeStringify, OIDC error messages, and catalog model reference config
Signed-off-by: benjdlambert <ben@blam.sh>
This commit is contained in:
@@ -219,7 +219,7 @@ describe('McpService', () => {
|
||||
text: JSON.stringify({ output: 'test' }),
|
||||
},
|
||||
]);
|
||||
expect((result as any).structuredContent).toEqual({ output: 'test' });
|
||||
expect(result).toHaveProperty('structuredContent', { output: 'test' });
|
||||
|
||||
const histogram = mockMetrics.createHistogram.mock.results[0]?.value;
|
||||
expect(histogram.record).toHaveBeenCalledTimes(1);
|
||||
|
||||
@@ -37,7 +37,7 @@ import { FilterRule, McpServerConfig } from '../config';
|
||||
|
||||
function safeStringify(value: unknown): string {
|
||||
try {
|
||||
return JSON.stringify(value);
|
||||
return JSON.stringify(value) ?? String(value);
|
||||
} catch {
|
||||
return String(value);
|
||||
}
|
||||
@@ -245,7 +245,7 @@ export class McpService {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(output),
|
||||
text: safeStringify(output),
|
||||
},
|
||||
],
|
||||
structuredContent: output,
|
||||
|
||||
Reference in New Issue
Block a user