aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Protocol/MCP/Tool.cpp
blob: 8e01f2bd5908b48c8e4dbb5bf5f76fac3f3afcf2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "lldb/Protocol/MCP/Tool.h"

using namespace lldb_protocol::mcp;

Tool::Tool(std::string name, std::string description)
    : m_name(std::move(name)), m_description(std::move(description)) {}

lldb_protocol::mcp::ToolDefinition Tool::GetDefinition() const {
  lldb_protocol::mcp::ToolDefinition definition;
  definition.name = m_name;
  definition.description = m_description;

  if (std::optional<llvm::json::Value> input_schema = GetSchema())
    definition.inputSchema = *input_schema;

  return definition;
}