LLDB mainline
Protocol/MCP/Tool.cpp
Go to the documentation of this file.
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-exception
6//
7//===----------------------------------------------------------------------===//
8
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
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}
Tool(std::string name, std::string description)
virtual std::optional< llvm::json::Value > GetSchema() const
lldb_protocol::mcp::ToolDefinition GetDefinition() const
Definition for a tool the client can call.
Definition Protocol.h:177
std::string description
Human-readable description.
Definition Protocol.h:182
std::string name
Unique identifier for the tool.
Definition Protocol.h:179
std::optional< llvm::json::Value > inputSchema
Definition Protocol.h:185