mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-21 20:24:42 +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 {
|
||||
const result = struct {
|
||||
resources: []const protocol.Resource,
|
||||
}{
|
||||
.resources = &resource_list,
|
||||
};
|
||||
|
||||
try server.sendResult(req.id.?, result);
|
||||
try server.sendResult(req.id.?, .{ .resources = &resource_list });
|
||||
}
|
||||
|
||||
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 {
|
||||
_ = arena;
|
||||
const result = struct {
|
||||
tools: []const protocol.Tool,
|
||||
}{
|
||||
.tools = &tool_list,
|
||||
};
|
||||
|
||||
try server.sendResult(req.id.?, result);
|
||||
try server.sendResult(req.id.?, .{ .tools = &tool_list });
|
||||
}
|
||||
|
||||
const GotoParams = struct {
|
||||
|
||||
Reference in New Issue
Block a user