mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-22 04:34:44 +00:00
mcp: simplify handleList implementations
This commit is contained in:
@@ -22,13 +22,7 @@ pub const resource_list = [_]protocol.Resource{
|
|||||||
};
|
};
|
||||||
|
|
||||||
pub fn handleList(server: *Server, req: protocol.Request) !void {
|
pub fn handleList(server: *Server, req: protocol.Request) !void {
|
||||||
const result = struct {
|
try server.sendResult(req.id.?, .{ .resources = &resource_list });
|
||||||
resources: []const protocol.Resource,
|
|
||||||
}{
|
|
||||||
.resources = &resource_list,
|
|
||||||
};
|
|
||||||
|
|
||||||
try server.sendResult(req.id.?, result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const ReadParams = struct {
|
const ReadParams = struct {
|
||||||
|
|||||||
@@ -91,13 +91,7 @@ pub const tool_list = [_]protocol.Tool{
|
|||||||
|
|
||||||
pub fn handleList(server: *Server, arena: std.mem.Allocator, req: protocol.Request) !void {
|
pub fn handleList(server: *Server, arena: std.mem.Allocator, req: protocol.Request) !void {
|
||||||
_ = arena;
|
_ = arena;
|
||||||
const result = struct {
|
try server.sendResult(req.id.?, .{ .tools = &tool_list });
|
||||||
tools: []const protocol.Tool,
|
|
||||||
}{
|
|
||||||
.tools = &tool_list,
|
|
||||||
};
|
|
||||||
|
|
||||||
try server.sendResult(req.id.?, result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const GotoParams = struct {
|
const GotoParams = struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user