/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import { retrospectivesListIncidentRetrospectives } from "../../funcs/retrospectivesListIncidentRetrospectives.js";
import { ListIncidentRetrospectivesRequest$zodSchema } from "../../models/listincidentretrospectivesop.js";
import { formatResult, ToolDefinition } from "../tools.js";
const args = {
request: ListIncidentRetrospectivesRequest$zodSchema,
};
export const tool$retrospectivesListIncidentRetrospectives: ToolDefinition<
typeof args
> = {
name: "list-retros-by-incident",
description:
`Lists all retrospectives (RCAs) for an incident. Among other things, this is useful for:
- Getting a list of retrospectives for an incident,
- Getting basic data about a retrospective.
- Getting the fields of a retrospective.
`,
scopes: ["read"],
annotations: {
"title": "",
"destructiveHint": false,
"idempotentHint": false,
"openWorldHint": false,
"readOnlyHint": false,
},
args,
tool: async (client, args, ctx) => {
const [result, apiCall] = await retrospectivesListIncidentRetrospectives(
client,
args.request,
{ fetchOptions: { signal: ctx.signal } },
).$inspect();
if (!result.ok) {
return {
content: [{ type: "text", text: result.error.message }],
isError: true,
};
}
const value = result.value;
return formatResult(value, apiCall);
},
};