| 1 | using AgentForge.Abstractions; |
| 2 | using AgentForge.Mcp.Core; |
| 3 | |
| 4 | namespace AgentForge.Plugin.Instance.UserManagement; |
| 5 | |
| 6 | internal static class ForgeInstanceAdminMcpTools |
| 7 | { |
| 8 | internal static void Register(ForgeMcpToolRegistry registry) |
| 9 | { |
| 10 | ForgeMcpHttpTools.Add(registry, InstanceAdminAddDescriptor, (client, args, ct) => |
| 11 | client.AddInstanceAdminAsync(ForgeMcpArgParser.ParseAddInstanceAdmin(args), ct)); |
| 12 | ForgeMcpHttpTools.Add(registry, InstanceAdminListDescriptor, (client, _, ct) => |
| 13 | client.ListInstanceAdminsAsync(ct)); |
| 14 | } |
| 15 | |
| 16 | private static readonly ForgeMcpToolDescriptor InstanceAdminAddDescriptor = new() |
| 17 | { |
| 18 | Name = ForgeMcpToolNames.InstanceAdminAdd, |
| 19 | Description = "Назначить instance admin (bootstrap or instance admin).", |
| 20 | InputSchema = ForgeMcpSchemas.Object(new |
| 21 | { |
| 22 | type = "object", |
| 23 | properties = new |
| 24 | { |
| 25 | provider = new { type = "string", description = "github" }, |
| 26 | login = new { type = "string" }, |
| 27 | }, |
| 28 | required = new[] { "provider", "login" }, |
| 29 | }), |
| 30 | }; |
| 31 | |
| 32 | private static readonly ForgeMcpToolDescriptor InstanceAdminListDescriptor = new() |
| 33 | { |
| 34 | Name = ForgeMcpToolNames.InstanceAdminList, |
| 35 | Description = "Список instance admins.", |
| 36 | InputSchema = ForgeMcpSchemas.EmptyObject, |
| 37 | }; |
| 38 | } |
| 39 | |