Fix/tools params#167
Conversation
| with HTTP 400. Drop any time/timezone component so both dates and | ||
| datetimes are accepted. | ||
| """ | ||
| return value.strip().replace(" ", "T").split("T", 1)[0] |
There was a problem hiding this comment.
I fear that this is brittle and will fail if the llm generates somehow another format. This is maybe overkill but we could use a BaseModel from pydantic (would need to add it to the dependencies, but it is a library we know well, and actually it's already bundled as a dependency of fastmcp) as it can parse any kind string into a date/datetime magically?
There was a problem hiding this comment.
Done, turns out pydantic was already used as a direct dependency, even if it was not declared as such.
|
|
||
| class UpdateIncidentStatusParams(BaseModel): | ||
| """Parameters for updating incident status.""" | ||
| class UpdateIncidentSeverityParams(BaseModel): |
There was a problem hiding this comment.
What is the relation between the previous (broken) status tool and the new one related to severity? I don't really understand why we do this replacement (I understand why the previous one was broken)
There was a problem hiding this comment.
The "PATCH incident" endpoint exists, and it allows to update an incident's severity: https://api.gitguardian.com/docs#tag/Internal-Secret-Incidents/operation/update-secret-incident
I considered it was more interesting to add this feature that was already 90% implemented rather than just delete the broken tool.
47eb9c4 to
454bf29
Compare
The incidents-for-mcp (and /count) endpoint filters on a date-only field and rejects ISO datetimes such as 2026-08-01T00:00:00Z with HTTP 400. The client forwarded date_before/date_after verbatim, so any datetime a caller supplied reached date__le/date__ge unchanged and 400'd. Truncate the time/timezone component in the client before building the query params, so both dates and datetimes are accepted for these date-only endpoints.
…ith `update_incident_severity` It's not possible to update the status of an incident with a PATCH request. This action needs to be performed via one of resolve/ignore/assign/unassign actions using the `manage_private_incident` tool.
454bf29 to
35fe247
Compare
Fixing two tools:
date_before/date_afterparameters requiring a date format when listing internal incidentsupdate_incident_statustool not working and replace it withupdate_incident_severity(to update an incident's status, one has to use themanage_private_incidenttool