Skip to content

Commit 7230331

Browse files
Copilotspech66
andauthored
Add Create tools to MCP Controllers analog to WeightsTool
Agent-Logs-Url: https://github.com/spech66/lifelogbb/sessions/7e140515-3e51-443c-9577-fd43318a821a Co-authored-by: spech66 <22615238+spech66@users.noreply.github.com>
1 parent c35920f commit 7230331

7 files changed

Lines changed: 49 additions & 0 deletions

File tree

LifelogBb/McpControllers/EnduranceTrainingsTool.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,12 @@ public async Task<IEnumerable<EnduranceTrainingOutput>> McpGetAll([Description("
1717
{
1818
return await GetAllFiltered(filter);
1919
}
20+
21+
[McpServerTool(Name = "CreateEnduranceTraining", Title = "Create endurance training entry"), Description("Create a new endurance training entry")]
22+
public async Task<EnduranceTrainingOutput?> Create(EnduranceTrainingInput model)
23+
{
24+
var result = await _service.Create(model);
25+
return result;
26+
}
2027
}
2128
}

LifelogBb/McpControllers/GoalsTool.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,12 @@ public async Task<IEnumerable<GoalOutput>> McpGetAll([Description("Optional JSON
1717
{
1818
return await GetAllFiltered(filter);
1919
}
20+
21+
[McpServerTool(Name = "CreateGoal", Title = "Create goal entry"), Description("Create a new goal entry")]
22+
public async Task<GoalOutput?> Create(GoalInput model)
23+
{
24+
var result = await _service.Create(model);
25+
return result;
26+
}
2027
}
2128
}

LifelogBb/McpControllers/HabitsTool.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,12 @@ public async Task<IEnumerable<HabitOutput>> McpGetAll([Description("Optional JSO
1717
{
1818
return await GetAllFiltered(filter);
1919
}
20+
21+
[McpServerTool(Name = "CreateHabit", Title = "Create habit entry"), Description("Create a new habit entry")]
22+
public async Task<HabitOutput?> Create(HabitInput model)
23+
{
24+
var result = await _service.Create(model);
25+
return result;
26+
}
2027
}
2128
}

LifelogBb/McpControllers/JournalsTool.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,12 @@ public async Task<IEnumerable<JournalOutput>> McpGetAll([Description("Optional J
1717
{
1818
return await GetAllFiltered(filter);
1919
}
20+
21+
[McpServerTool(Name = "CreateJournal", Title = "Create journal entry"), Description("Create a new journal entry")]
22+
public async Task<JournalOutput?> Create(JournalInput model)
23+
{
24+
var result = await _service.Create(model);
25+
return result;
26+
}
2027
}
2128
}

LifelogBb/McpControllers/QuotesTool.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,12 @@ public async Task<IEnumerable<QuoteOutput>> McpGetAll([Description("Optional JSO
1717
{
1818
return await GetAllFiltered(filter);
1919
}
20+
21+
[McpServerTool(Name = "CreateQuote", Title = "Create quote entry"), Description("Create a new quote entry")]
22+
public async Task<QuoteOutput?> Create(QuoteInput model)
23+
{
24+
var result = await _service.Create(model);
25+
return result;
26+
}
2027
}
2128
}

LifelogBb/McpControllers/StrengthTrainingsTool.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,12 @@ public async Task<IEnumerable<StrengthTrainingOutput>> McpGetAll([Description("O
1717
{
1818
return await GetAllFiltered(filter);
1919
}
20+
21+
[McpServerTool(Name = "CreateStrengthTraining", Title = "Create strength training entry"), Description("Create a new strength training entry")]
22+
public async Task<StrengthTrainingOutput?> Create(StrengthTrainingInput model)
23+
{
24+
var result = await _service.Create(model);
25+
return result;
26+
}
2027
}
2128
}

LifelogBb/McpControllers/TodosTool.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,12 @@ public async Task<IEnumerable<TodoOutput>> McpGetAll([Description("Optional JSON
1717
{
1818
return await GetAllFiltered(filter);
1919
}
20+
21+
[McpServerTool(Name = "CreateTodo", Title = "Create todo entry"), Description("Create a new todo entry")]
22+
public async Task<TodoOutput?> Create(TodoInput model)
23+
{
24+
var result = await _service.Create(model);
25+
return result;
26+
}
2027
}
2128
}

0 commit comments

Comments
 (0)