-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAppliancesMcpQueryService.cs
More file actions
92 lines (83 loc) · 3.91 KB
/
AppliancesMcpQueryService.cs
File metadata and controls
92 lines (83 loc) · 3.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
namespace CasCap.Services;
/// <summary>
/// MCP wrapper for <see cref="IMieleQueryService"/> that exposes home appliance operations as MCP tools.
/// </summary>
[McpServerToolType]
public partial class AppliancesMcpQueryService(IMieleQueryService mieleQuerySvc)
{
/// <inheritdoc cref="IMieleQueryService.GetDevices"/>
[McpServerTool]
[Description("Lists all household appliances with full identification and current state.")]
public Task<Dictionary<string, MieleDevice>?> GetAllAppliances(
[Description("Language code, e.g. en, de.")]
string language = "en")
=> mieleQuerySvc.GetDevices(language);
/// <inheritdoc cref="IMieleQueryService.GetShortDevices"/>
[McpServerTool]
[Description("Compact summary of all household appliances — serial number, type and status only.")]
public Task<MieleShortDevice[]?> GetAllAppliancesSummary(
[Description("Language code, e.g. en, de.")]
string language = "en")
=> mieleQuerySvc.GetShortDevices(language);
/// <inheritdoc cref="IMieleQueryService.GetDevice"/>
[McpServerTool]
[Description("Full detail for one appliance — identification and current state.")]
public Task<MieleDevice?> GetAppliance(
[Description("Device serial number.")]
string deviceId,
[Description("Language code, e.g. en, de.")]
string language = "en")
=> mieleQuerySvc.GetDevice(deviceId, language);
/// <inheritdoc cref="IMieleQueryService.GetIdent"/>
[McpServerTool]
[Description("Identification info for one appliance — model name, type and serial number.")]
public Task<MieleIdent?> GetApplianceIdentification(
[Description("Device serial number.")]
string deviceId,
[Description("Language code, e.g. en, de.")]
string language = "en")
=> mieleQuerySvc.GetIdent(deviceId, language);
/// <inheritdoc cref="IMieleQueryService.GetState"/>
[McpServerTool]
[Description("Operational state of one appliance — status, program phase, remaining time and temperatures.")]
public Task<MieleState?> GetApplianceState(
[Description("Device serial number.")]
string deviceId,
[Description("Language code, e.g. en, de.")]
string language = "en")
=> mieleQuerySvc.GetState(deviceId, language);
/// <inheritdoc cref="IMieleQueryService.GetActions"/>
[McpServerTool]
[Description("Currently available actions for one appliance (e.g. start, stop, powerOn, powerOff).")]
public Task<MieleActions?> GetApplianceActions(
[Description("Device serial number.")]
string deviceId)
=> mieleQuerySvc.GetActions(deviceId);
/// <inheritdoc cref="IMieleQueryService.PutAction"/>
[McpServerTool]
[Description("Executes an action on one appliance — powerOn, powerOff, start or stop.")]
public Task<bool> ExecuteApplianceAction(
[Description("Device serial number.")]
string deviceId,
[Description("Action payload object.")]
object action)
=> mieleQuerySvc.PutAction(deviceId, action);
/// <inheritdoc cref="IMieleQueryService.GetPrograms"/>
[McpServerTool]
[Description("Lists the selectable programs for one appliance.")]
public Task<MieleProgram[]?> GetAppliancePrograms(
[Description("Device serial number.")]
string deviceId,
[Description("Language code, e.g. en, de.")]
string language = "en")
=> mieleQuerySvc.GetPrograms(deviceId, language);
/// <inheritdoc cref="IMieleQueryService.PutProgram"/>
[McpServerTool]
[Description("Selects and starts a program on one appliance. Requires MobileStart or MobileControl mode.")]
public Task<bool> StartApplianceProgram(
[Description("Device serial number.")]
string deviceId,
[Description("Program selection payload.")]
object programRequest)
=> mieleQuerySvc.PutProgram(deviceId, programRequest);
}