Skip to main content
Glama

update_case

Modify existing test cases in QASE by updating fields like title, description, steps, severity, priority, tags, and custom parameters to maintain accurate testing documentation.

Instructions

Update an existing test case

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
idYes
titleNo
descriptionNo
preconditionsNo
postconditionsNo
severityNo
priorityNo
typeNo
behaviorNo
automationNo
statusNo
suite_idNo
milestone_idNo
layerNo
is_flakyNo
paramsNo
tagsNo
stepsNo
custom_fieldsNo

Implementation Reference

  • MCP tool handler for 'update_case': parses input using UpdateCaseSchema, extracts code, id, and rest data, then calls the updateCase function.
    .with({ name: 'update_case' }, ({ arguments: args }) => { const { code, id, ...caseData } = UpdateCaseSchema.parse(args); return updateCase(code, id, caseData); })
  • Zod schema defining the input structure for updating a test case, including code, id, and optional fields like title, steps, tags, etc.
    export const UpdateCaseSchema = z.object({ code: z.string(), id: z.number(), title: z.string().optional(), description: z.string().optional(), preconditions: z.string().optional(), postconditions: z.string().optional(), severity: z.number().optional(), priority: z.number().optional(), type: z.number().optional(), behavior: z.number().optional(), automation: z.number().optional(), status: z.number().optional(), suite_id: z.number().optional(), milestone_id: z.number().optional(), layer: z.number().optional(), is_flaky: z.boolean().optional(), params: z .array( z.object({ title: z.string(), value: z.string(), }), ) .optional(), tags: z.array(z.string()).optional(), steps: z .array( z.object({ action: z.string(), expected_result: z.string().optional(), data: z.string().optional(), position: z.number().optional(), }), ) .optional(), custom_fields: z .array( z.object({ id: z.number(), value: z.string(), }), ) .optional(), });
  • src/index.ts:185-189 (registration)
    Tool registration in the list of available tools, specifying name, description, and input schema converted to JSON schema.
    { name: 'update_case', description: 'Update an existing test case', inputSchema: zodToJsonSchema(UpdateCaseSchema), },
  • Core updateCase function that transforms data using convertCaseData and calls the Qase client API to update the case, wrapped with toResult.
    export const updateCase = pipe( ( code: string, id: number, data: Omit<z.infer<typeof UpdateCaseSchema>, 'code' | 'id'>, ) => client.cases.updateCase(code, id, convertCaseData(data)), toResult, );
  • Helper function to convert the case data format, specifically handling is_flaky boolean to int and params array to object.
    const convertCaseData = ( data: Omit<z.infer<typeof UpdateCaseSchema>, 'code' | 'id'>, ) => ({ ...data, is_flaky: data.is_flaky === undefined ? undefined : data.is_flaky ? 1 : 0, params: data.params ? data.params.reduce( (acc, param) => ({ ...acc, [param.title]: [param.value], }), {}, ) : undefined, });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/rikuson/mcp-qase'

If you have feedback or need assistance with the MCP directory API, please join our Discord server