LLDB
mainline
llvm-project
lldb
source
Protocol
MCP
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
9
#include "
lldb/Protocol/MCP/Tool.h
"
10
11
using namespace
lldb_protocol::mcp
;
12
13
Tool::Tool
(std::string name, std::string description)
14
:
m_name
(std::move(name)),
m_description
(std::move(description)) {}
15
16
lldb_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
}
lldb_protocol::mcp::Tool::Tool
Tool(std::string name, std::string description)
Definition
Protocol/MCP/Tool.cpp:13
lldb_protocol::mcp::Tool::GetSchema
virtual std::optional< llvm::json::Value > GetSchema() const
Definition
include/lldb/Protocol/MCP/Tool.h:27
lldb_protocol::mcp::Tool::m_description
std::string m_description
Definition
include/lldb/Protocol/MCP/Tool.h:37
lldb_protocol::mcp::Tool::m_name
std::string m_name
Definition
include/lldb/Protocol/MCP/Tool.h:36
lldb_protocol::mcp::Tool::GetDefinition
lldb_protocol::mcp::ToolDefinition GetDefinition() const
Definition
Protocol/MCP/Tool.cpp:16
Tool.h
lldb_protocol::mcp
Definition
MCPError.h:16
lldb_protocol::mcp::ToolDefinition
Definition for a tool the client can call.
Definition
Protocol.h:177
lldb_protocol::mcp::ToolDefinition::description
std::string description
Human-readable description.
Definition
Protocol.h:182
lldb_protocol::mcp::ToolDefinition::name
std::string name
Unique identifier for the tool.
Definition
Protocol.h:179
lldb_protocol::mcp::ToolDefinition::inputSchema
std::optional< llvm::json::Value > inputSchema
Definition
Protocol.h:185
Generated on
for LLDB by
1.14.0