Skip to main content
Glama

Update test artifacts

wopee_update_artifact

Replace the content of a test artifact in a suite with your own custom content, such as APP_CONTEXT or user stories, to upload or fix artifacts without prior generation.

Instructions

Create or overwrite a test artifact in a suite with caller-supplied content. The full content is replaced, not patched. Use this to upload your own APP_CONTEXT (e.g. built from JIRA / Confluence), user stories, project context, or Playwright code, or to fix / refine an artifact previously authored by wopee_generate_artifact. Works on any suite, including freshly-created blank suites with no prior generation — the artifact does not need to exist beforehand. Use wopee_generate_artifact instead when you want the Wopee.io AI engine to author the content from scratch. On success, returns confirmation. On failure (e.g. invalid suite UUID, storage misconfiguration), returns an error message. Idempotent: calling with the same content multiple times produces the same result.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYesType of test artifact to update. One of: APP_CONTEXT, GENERAL_USER_STORIES, USER_STORIES, PLAYWRIGHT_CODE (requires identifier), PROJECT_CONTEXT. Must match the type used when the artifact was generated.
contentYesThe complete new content to replace the existing artifact. This is a destructive overwrite — the entire previous content is replaced. Pass the full updated content, not a partial diff.
suiteUuidYesUUID of the analysis suite containing the artifact to update. Get this from wopee_fetch_analysis_suites.
identifierNoTest case identifier in format 'US004:TC006'. Required only when type is PLAYWRIGHT_CODE. Ignored for all other artifact types.

Implementation Reference

  • The `updateArtifact` function - the core handler that destructures input (type, suiteUuid, content, identifier), builds the update input via factory, validates with Zod schema, executes the UpdateArtifact GraphQL mutation, and returns success/failure.
    export async function updateArtifact(input: UpdateArtifactHandlerInput) {
      try {
        const { type, suiteUuid, content, identifier } = input;
    
        const updateArtifactInput = createUpdateArtifactInput({
          type,
          content,
          suiteUuid,
          ...(identifier ? { identifier } : {}),
        });
    
        const parsedInput = UpdateArtifactInputSchema.parse(updateArtifactInput);
        const updateFileResult = await requestClient<{
          updateArtifact: boolean;
        }>(UpdateArtifact, {
          input: parsedInput,
        });
        if (!updateFileResult?.updateArtifact)
          return {
            content: [
              {
                type: "text" as const,
                text: "Failed to update file: operation returned false",
              },
            ],
          };
    
        return {
          content: [
            {
              type: "text" as const,
              text: "File updated successfully",
            },
          ],
        };
      } catch (error) {
        return _parseError(error);
      }
    }
  • The tool definition/registration for 'wopee_update_artifact' - exports a tool object with ToolName.WOPEE_UPDATE_ARTIFACT, metadata/description, inputSchema from UpdateArtifactHandlerInputSchema, and a handler delegation to updateArtifact().
    import {
      UpdateArtifactHandlerInput,
      UpdateArtifactHandlerInputSchema,
    } from "../shared/schemas.js";
    import { ToolName } from "../shared/types.js";
    import { updateArtifact } from "../shared/handlers.js";
    
    export const wopeeUpdateArtifact = {
      name: ToolName.WOPEE_UPDATE_ARTIFACT,
      config: {
        title: "Update test artifacts",
        description:
          "Create or overwrite a test artifact in a suite with caller-supplied content. The full content is replaced, not patched. Use this to upload your own APP_CONTEXT (e.g. built from JIRA / Confluence), user stories, project context, or Playwright code, or to fix / refine an artifact previously authored by wopee_generate_artifact. Works on any suite, including freshly-created blank suites with no prior generation — the artifact does not need to exist beforehand. Use wopee_generate_artifact instead when you want the Wopee.io AI engine to author the content from scratch. On success, returns confirmation. On failure (e.g. invalid suite UUID, storage misconfiguration), returns an error message. Idempotent: calling with the same content multiple times produces the same result.",
        inputSchema: UpdateArtifactHandlerInputSchema.shape,
      },
      handler: async (input: UpdateArtifactHandlerInput) =>
        await updateArtifact(input),
    };
  • Input schema (UpdateArtifactHandlerInputSchema) defining the validation for type (ArtifactType enum), content (string), suiteUuid (string), and optional identifier (string).
    export const UpdateArtifactHandlerInputSchema = z.object({
      type: z.nativeEnum(ArtifactType, {
        description:
          "Type of test artifact to update. One of: APP_CONTEXT, GENERAL_USER_STORIES, USER_STORIES, PLAYWRIGHT_CODE (requires identifier), PROJECT_CONTEXT. Must match the type used when the artifact was generated.",
      }),
      content: z.string({
        description:
          "The complete new content to replace the existing artifact. This is a destructive overwrite — the entire previous content is replaced. Pass the full updated content, not a partial diff.",
      }),
      suiteUuid: z
        .string({
          description:
            "UUID of the analysis suite containing the artifact to update. Get this from wopee_fetch_analysis_suites.",
        })
        .min(1, "Suite UUID is required"),
      identifier: z
        .string({
          description:
            "Test case identifier in format 'US004:TC006'. Required only when type is PLAYWRIGHT_CODE. Ignored for all other artifact types.",
        })
        .optional(),
    });
  • TypeScript type UpdateArtifactHandlerInput inferred from the Zod schema, used in the handler signature.
    export type UpdateArtifactHandlerInput = z.infer<
      typeof UpdateArtifactHandlerInputSchema
    >;
    export type UpdateArtifactFactoryInput = z.infer<
      typeof UpdateArtifactFactoryInputSchema
    >;
    export type UpdateArtifactInput = z.infer<typeof UpdateArtifactInputSchema>;
  • Factory function `createUpdateArtifactInput` that enriches user input with the project UUID from config, producing the full UpdateArtifactInput for the GraphQL mutation.
    export const createUpdateArtifactInput = (
      input: UpdateArtifactFactoryInput
    ): UpdateArtifactInput => {
      const { WOPEE_PROJECT_UUID } = getConfig();
      if (!WOPEE_PROJECT_UUID) throw new Error("WOPEE_PROJECT_UUID is not set");
    
      const { type, suiteUuid, content, identifier } = input;
    
      return {
        type,
        content,
        suiteUuid,
        projectUuid: WOPEE_PROJECT_UUID,
        ...(identifier ? { identifier } : {}),
      };
    };
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of disclosing behavioral traits. It states that content is fully replaced (not patched), that the operation is idempotent, and describes success/error behavior. However, it does not mention authentication requirements or rate limits, though these are minor omissions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise (4 sentences) and well-structured, with each sentence serving a clear purpose: stating the main function, explaining replacement semantics, providing usage guidance, and describing idempotency and error handling. No unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (4 parameters, no output schema, no annotations), the description covers all essential aspects: purpose, behavioral traits (overwrite, idempotent), when to use vs. sibling, error scenarios, and parameter roles. It provides sufficient context for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so a baseline of 3 is appropriate. The description reinforces the full-replacement nature of the 'content' parameter and mentions the conditional requirement of 'identifier' for PLAYWRIGHT_CODE, but adds little beyond what the schema already provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Create or overwrite a test artifact in a suite with caller-supplied content.' It specifies the verb (create/overwrite) and the resource (test artifact), and explicitly distinguishes from sibling tool wopee_generate_artifact by contrasting when to use each.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance: use this tool for uploading your own content or refining AI-generated artifacts, and use wopee_generate_artifact when you want the AI engine to author from scratch. It also notes that the tool works on any suite, including blank ones, clarifying when it's applicable.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/Wopee-io/wopee-mcp'

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