File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
packages/core/src/integrations/mcp-server Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -393,9 +393,7 @@ export function extractPromptResultAttributes(result: unknown): Record<string, s
393
393
394
394
const resultObj = result as Record < string , unknown > ;
395
395
396
- if ( typeof resultObj . description === 'string' ) {
397
- attributes [ MCP_PROMPT_RESULT_DESCRIPTION_ATTRIBUTE ] = resultObj . description ;
398
- }
396
+ if ( typeof resultObj . description === 'string' ) attributes [ MCP_PROMPT_RESULT_DESCRIPTION_ATTRIBUTE ] = resultObj . description ;
399
397
400
398
if ( Array . isArray ( resultObj . messages ) ) {
401
399
attributes [ MCP_PROMPT_RESULT_MESSAGE_COUNT_ATTRIBUTE ] = resultObj . messages . length ;
@@ -405,15 +403,11 @@ export function extractPromptResultAttributes(result: unknown): Record<string, s
405
403
if ( typeof message === 'object' && message !== null ) {
406
404
const messageObj = message as Record < string , unknown > ;
407
405
408
- if ( typeof messageObj . role === 'string' ) {
409
- attributes [ MCP_PROMPT_RESULT_MESSAGE_ROLE_ATTRIBUTE ] = messageObj . role ;
410
- }
406
+ if ( typeof messageObj . role === 'string' ) attributes [ MCP_PROMPT_RESULT_MESSAGE_ROLE_ATTRIBUTE ] = messageObj . role ;
411
407
412
408
if ( typeof messageObj . content === 'object' && messageObj . content !== null ) {
413
409
const content = messageObj . content as Record < string , unknown > ;
414
- if ( typeof content . text === 'string' ) {
415
- attributes [ MCP_PROMPT_RESULT_MESSAGE_CONTENT_ATTRIBUTE ] = content . text ;
416
- }
410
+ if ( typeof content . text === 'string' ) attributes [ MCP_PROMPT_RESULT_MESSAGE_CONTENT_ATTRIBUTE ] = content . text ;
417
411
}
418
412
}
419
413
}
You can’t perform that action at this time.
0 commit comments