본문 바로가기
WIKI 기술 지식 베이스

Update MCP Tools API

원문 보기 위키 갱신

출처: 문서

본문

MCP Tools API 업데이트

3.0에서 도입됨 {: .label .label-purple }

이 API를 사용하여 하나 이상의 MCP(Model Context Protocol) 기반 도구를 업데이트해요. 지원되는 도구에 대한 자세한 내용은 도구를 참조하세요.

엔드포인트

POST /_plugins/_ml/mcp/tools/_update

요청 본문 필드

다음 표에서는 사용 가능한 요청 필드를 보여줘요.

필드 데이터 타입 필수/선택 설명
tools Array 필수 도구 목록.

tools 배열에는 도구 목록이 포함돼요. 각 도구에는 다음 필드가 있어요.

필드 | 데이터 타입 | 필수/선택 | 설명 :--- | :--- | :--- name| String | 필수 | 업데이트할 도구의 이름. type | String | 선택 | 도구 유형. 지원되는 도구 목록은 도구를 참조하세요. description | String | 선택 | 도구의 설명. parameters | Object | 선택 | 도구의 매개변수예요. 매개변수는 도구 유형에 따라 달라져요. 특정 도구 유형에 대한 자세한 내용은 도구를 참조하세요. attributes | Object | 선택 | 도구의 구성 속성이에요. 이 필드에서 가장 중요한 속성은 도구의 input_schema로, 도구에 필요한 매개변수 형식을 정의해요. 이 스키마는 대규모 언어 모델(LLM)로 전송되어 도구 실행 시 매개변수를 적절히 형식화할 수 있게 해요.

예제 요청

다음 섹션에서는 도구 업데이트를 위한 예제 요청을 제공해요. 도구별 매개변수에 대한 자세한 내용은 해당 도구 문서를 참조하세요.

WebSearchTool

POST /_plugins/_ml/mcp/tools/_update
{
  "tools": [
    {
      "type": "WebSearchTool",
      "name": "GoogleSearchTool",
      "description": "This tool can be used to perform search via google engine and parse the content of the searched results",
      "attributes": {
        "input_schema": {
          "type": "object",
          "properties": {
            "engine": {
              "type": "string",
              "description": "The search engine that will be used by the tool."
            },
            "query": {
              "type": "string",
              "description": "The search query parameter that will be used by the engine to perform the search."
            },
            "next_page": {
              "type": "string",
              "description": "The search result's next page link. If this is provided, the WebSearchTool will fetch the next page results using this link and crawl the links on the page."
            }
          },
          "required": [
            "engine",
            "query"
          ]
        },
        "strict": false
      }
    }
  ]
}

{% include copy-curl.html %}

PPLTool

POST /_plugins/_ml/mcp/tools/_update
{
  "type": "PPLTool",
  "name": "TransferQuestionToPPLAndExecuteTool",
  "description": "Use this tool to convert natural language into PPL queries and execute them. Use this tool after you know the index name; otherwise, call IndexRoutingTool first. The input parameters are: {index: IndexName, question: UserQuestion}",
  "parameters": {
    "model_id": "${your_model_id}",
    "model_type": "FINETUNE"
  },
  "attributes": {
    "input_schema": {
      "type": "object",
      "properties": {
        "question": {
          "type": "string",
          "description": "The user's natural language question that needs to be converted to PPL."
        },
        "index": {
          "type": "string",
          "description": "The index on which the generated PPL query will be executed."
        }
      }
    }
  }
}

{% include copy-curl.html %}

예제 응답

각 노드에 대해 OpenSearch는 노드 ID와 모든 도구에 대한 업데이트 작업 상태를 응답해요.

{
    "_ZNV5BrNTVm6ilcM7Jn1pw": {
        "updated": true
    },
    "NZ9aiUCrSp2b5KBqdJGJKw": {
        "updated": true
    }
}

더 알아보기 (Learn more)