26 lines · cpp
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#include "lldb/Protocol/MCP/Tool.h"10 11using namespace lldb_protocol::mcp;12 13Tool::Tool(std::string name, std::string description)14 : m_name(std::move(name)), m_description(std::move(description)) {}15 16lldb_protocol::mcp::ToolDefinition Tool::GetDefinition() const {17 lldb_protocol::mcp::ToolDefinition definition;18 definition.name = m_name;19 definition.description = m_description;20 21 if (std::optional<llvm::json::Value> input_schema = GetSchema())22 definition.inputSchema = *input_schema;23 24 return definition;25}26