fix(mcp) : typer les éléments des params tableaux d'IDs (items: integer)
Auto Tag Develop / tag (push) Successful in 11s

Les params tableaux (tagIds, collaboratorIds) des tools create-task,
update-task, list-tasks, create-time-entry et update-time-entry
généraient un schéma { type: [array, null] } sans clé items : aucune
contrainte sur le type des éléments, d'où des IDs pouvant transiter en
string. Ajout d'un docblock @param int[] sur chaque __invoke pour que le
SchemaGenerator du SDK MCP produise items: { type: integer }, ce qui
force la validation à n'accepter que des entiers.
This commit is contained in:
Matthieu
2026-05-27 09:41:29 +02:00
parent 7e32e4c013
commit 4334420625
5 changed files with 17 additions and 0 deletions
+4
View File
@@ -41,6 +41,10 @@ class CreateTaskTool
private readonly CalDavService $calDavService, private readonly CalDavService $calDavService,
) {} ) {}
/**
* @param int[] $tagIds IDs of the tags to attach
* @param int[] $collaboratorIds IDs of the collaborators to attach
*/
public function __invoke( public function __invoke(
int $projectId, int $projectId,
string $title, string $title,
+3
View File
@@ -18,6 +18,9 @@ class ListTasksTool
private readonly Security $security, private readonly Security $security,
) {} ) {}
/**
* @param int[] $tagIds IDs of the tags to filter by
*/
public function __invoke( public function __invoke(
?int $projectId = null, ?int $projectId = null,
?int $statusId = null, ?int $statusId = null,
+4
View File
@@ -38,6 +38,10 @@ class UpdateTaskTool
private readonly CalDavService $calDavService, private readonly CalDavService $calDavService,
) {} ) {}
/**
* @param int[] $tagIds IDs of the tags to attach
* @param int[] $collaboratorIds IDs of the collaborators to attach
*/
public function __invoke( public function __invoke(
int $id, int $id,
?string $title = null, ?string $title = null,
@@ -33,6 +33,9 @@ class CreateTimeEntryTool
private readonly Security $security, private readonly Security $security,
) {} ) {}
/**
* @param int[] $tagIds IDs of the tags to attach
*/
public function __invoke( public function __invoke(
int $userId, int $userId,
string $startedAt, string $startedAt,
@@ -30,6 +30,9 @@ class UpdateTimeEntryTool
private readonly Security $security, private readonly Security $security,
) {} ) {}
/**
* @param int[] $tagIds IDs of the tags to attach
*/
public function __invoke( public function __invoke(
int $id, int $id,
?string $title = null, ?string $title = null,