EarthSDK
    正在准备搜索索引...

    函数 getErrorResult

    • 参数

      • 可选data: any
      • 可选msg: string

      返回 {
          _meta?: { [key: string]: unknown };
          content: (
              | {
                  _meta?: { [key: string]: unknown };
                  text: string;
                  type: "text";
                  [key: string]: unknown;
              }
              | {
                  _meta?: { [key: string]: unknown };
                  data: string;
                  mimeType: string;
                  type: "image";
                  [key: string]: unknown;
              }
              | {
                  _meta?: { [key: string]: unknown };
                  data: string;
                  mimeType: string;
                  type: "audio";
                  [key: string]: unknown;
              }
              | {
                  _meta?: { [key: string]: unknown };
                  description?: string;
                  icons?: {
                      mimeType?: string;
                      sizes?: string[];
                      src: string;
                      [key: string]: unknown;
                  }[];
                  mimeType?: string;
                  name: string;
                  title?: string;
                  type: "resource_link";
                  uri: string;
                  [key: string]: unknown;
              }
              | {
                  _meta?: { [key: string]: unknown };
                  resource:
                      | {
                          _meta?: { [key: string]: unknown };
                          mimeType?: string;
                          text: string;
                          uri: string;
                          [key: string]: unknown;
                      }
                      | {
                          _meta?: { [key: string]: unknown };
                          blob: string;
                          mimeType?: string;
                          uri: string;
                          [key: string]: unknown;
                      };
                  type: "resource";
                  [key: string]: unknown;
              }
          )[];
          isError?: boolean;
          structuredContent?: { [key: string]: unknown };
          [key: string]: unknown;
      }

      • [key: string]: unknown
      • 可选_meta?: { [key: string]: unknown }

        See MCP specification for notes on _meta usage.

      • content: (
            | {
                _meta?: { [key: string]: unknown };
                text: string;
                type: "text";
                [key: string]: unknown;
            }
            | {
                _meta?: { [key: string]: unknown };
                data: string;
                mimeType: string;
                type: "image";
                [key: string]: unknown;
            }
            | {
                _meta?: { [key: string]: unknown };
                data: string;
                mimeType: string;
                type: "audio";
                [key: string]: unknown;
            }
            | {
                _meta?: { [key: string]: unknown };
                description?: string;
                icons?: {
                    mimeType?: string;
                    sizes?: string[];
                    src: string;
                    [key: string]: unknown;
                }[];
                mimeType?: string;
                name: string;
                title?: string;
                type: "resource_link";
                uri: string;
                [key: string]: unknown;
            }
            | {
                _meta?: { [key: string]: unknown };
                resource:
                    | {
                        _meta?: { [key: string]: unknown };
                        mimeType?: string;
                        text: string;
                        uri: string;
                        [key: string]: unknown;
                    }
                    | {
                        _meta?: { [key: string]: unknown };
                        blob: string;
                        mimeType?: string;
                        uri: string;
                        [key: string]: unknown;
                    };
                type: "resource";
                [key: string]: unknown;
            }
        )[]

        A list of content objects that represent the result of the tool call.

        If the Tool does not define an outputSchema, this field MUST be present in the result. For backwards compatibility, this field is always present, but it may be empty.

      • 可选isError?: boolean

        Whether the tool call ended in an error.

        If not set, this is assumed to be false (the call was successful).

        Any errors that originate from the tool SHOULD be reported inside the result object, with isError set to true, not as an MCP protocol-level error response. Otherwise, the LLM would not be able to see that an error occurred and self-correct.

        However, any errors in finding the tool, an error indicating that the server does not support tool calls, or any other exceptional conditions, should be reported as an MCP error response.

      • 可选structuredContent?: { [key: string]: unknown }

        An object containing structured tool output.

        If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema.