McpToolResponse class

명시적인 콘텐츠 블록과 선택적 구조화된 콘텐츠가 포함된 완전한 MCP 도구 응답. 콘텐츠 배열과 structuredContent. 모두를 완전히 제어해야 할 때는 툴 핸들러에서 이 클래스의 인스턴스를 반환합니다.

return new McpToolResponse({
  content: [
    new McpTextContent('Here is the image'),
    new McpImageContent({ data: base64Data, mimeType: 'image/png' })
  ],
  structuredContent: { imageId: 'logo', format: 'png' }
});

생성자 세부 정보

McpToolResponse(McpToolResponseInit)

new McpToolResponse(init: McpToolResponseInit)

매개 변수

속성 세부 정보

content

content: McpContentBlock[]

속성 값

isError

isError?: boolean

속성 값

boolean

structuredContent

structuredContent?: unknown

속성 값

unknown