Skip to main content
Glama
dolrea77
by dolrea77

save_qa_script

Validate and save a Playwright script for automated inspection. Detects syntax or format errors in the script code and returns error details so you can fix and retry.

Instructions

에이전트가 생성한 Playwright 스크립트를 구문 검증하고 저장합니다. 검증 실패 시 에러 메시지를 반환하므로 수정 후 재시도할 수 있습니다.

[스크립트 작성 규약]

  • export 형식: module.exports = async (page) => { ... } (CommonJS)

  • 인자: page (Playwright Page 객체) 하나만 전달됨. ({ page, expect }) 구조분해 사용 금지

  • 반환: { pass: boolean, message: string, details?: object } 객체를 반드시 return

  • import 금지: @playwright/test 등 외부 모듈 import/require 사용 금지. page 객체는 이미 제공됨

  • 페이지 이동: 첫 페이지는 runner가 page.goto()로 이동 완료 후 스크립트 실행. 추가 이동만 작성

  • Playwright API: page.locator(), page.click(), page.waitForSelector() 등 자유롭게 사용 가능

  • 검증: expect 대신 직접 조건 체크 후 pass/message로 결과 반환

[올바른 예시] module.exports = async (page) => { const title = await page.locator('h1').textContent(); if (!title) return { pass: false, message: '제목을 찾을 수 없습니다' }; return { pass: true, message: '제목 확인 완료: ' + title }; };

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
item_idYes대상 항목 ID
script_codeYes에이전트가 생성한 Playwright 스크립트 코드
Behavior5/5

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

With no annotations, the description fully discloses the tool's behavior: it performs syntax validation, returns error messages on failure, and enforces specific script constraints (CommonJS export, single page argument, no external imports, required return object). It also clarifies that the first page navigation is handled by the runner, adding important behavioral context.

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 lengthy but well-structured: it starts with a one-sentence purpose, then breaks conventions into bullet points, and includes a concrete example. Every section contributes necessary constraints and guidance, making the length justified rather than wasteful.

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 (script validation with many rules) and lack of an output schema, the description is highly complete. It covers the full script contract, failure behavior, and provides a working example. Nothing critical is missing for an agent to invoke the tool correctly.

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

Parameters5/5

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

Although the schema describes both parameters, the description adds significant meaning to script_code by specifying the exact expected format, return shape, and forbidden patterns. This goes well beyond the schema's one-line description and is essential for correct usage.

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 '에이전트가 생성한 Playwright 스크립트를 구문 검증하고 저장합니다' (validates and saves the agent-generated Playwright script), using a specific verb and resource. It is easily distinguished from sibling tools like register_qa_sheet or run_qa, as it focuses on saving and validating a script.

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 an explicit '스크립트 작성 규약' section with detailed rules on export format, arguments, return value, and prohibited imports. It also explains that on validation failure an error message is returned so the script can be fixed and retried, giving clear context for when and how to use the tool.

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/dolrea77/inspection-mcp'

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