Skip to main content
Glama

pilot_page_forms

Extract all form fields from web pages as structured JSON data for browser automation and data processing tasks.

Instructions

Get all form fields on the page as structured JSON.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Implementation of the 'pilot_page_forms' tool, which iterates through forms on the page and extracts their fields as structured JSON.
    server.tool(
      'pilot_page_forms',
      'Get all form fields on the page as structured JSON.',
      {},
      async () => {
        await bm.ensureBrowser();
        try {
          const forms = await bm.getPage().evaluate(() => {
            return [...document.querySelectorAll('form')].map((form, i) => {
              const fields = [...form.querySelectorAll('input, select, textarea')].map(el => {
                const input = el as HTMLInputElement;
                return {
                  tag: el.tagName.toLowerCase(),
                  type: input.type || undefined,
                  name: input.name || undefined,
                  id: input.id || undefined,
                  placeholder: input.placeholder || undefined,
                  required: input.required || undefined,
                  value: input.type === 'password' ? '[redacted]' : (input.value || undefined),
                };
              });
              return { index: i, action: form.action || undefined, method: form.method || 'get', id: form.id || undefined, fields };
            });
          });
          return { content: [{ type: 'text' as const, text: JSON.stringify(forms, null, 2) }] };
        } catch (err) {
          return { content: [{ type: 'text' as const, text: wrapError(err) }], isError: true };
        }
      }
    );
Behavior3/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 behavioral disclosure. While 'Get' implies a read-only operation, the description does not explicitly confirm safety (no mutations), describe the JSON structure beyond 'structured', or explain behavior when no forms exist on the page.

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 a single, efficient sentence where every phrase earns its place: action ('Get'), target ('all form fields'), scope ('on the page'), and output format ('as structured JSON'). No fluff or redundancy.

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

Completeness3/5

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

For a data extraction tool with no output schema, the description should ideally describe the JSON structure (e.g., whether it includes field names, types, values, selectors). Given the rich ecosystem of sibling tools and lack of annotations, the description is minimally adequate but misses opportunity to clarify the data structure returned.

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

Parameters4/5

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

The input schema contains zero parameters, which per evaluation guidelines sets a baseline score of 4. The description correctly implies no filtering or targeting parameters are needed, which aligns with the empty schema.

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

Purpose4/5

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

The description clearly states the action ('Get'), target ('form fields'), scope ('on the page'), and format ('structured JSON'). However, it does not explicitly differentiate from siblings like `pilot_element_state` (which could retrieve individual field states) or `pilot_fill` (which interacts with forms), leaving some ambiguity about when to prefer this over element-specific inspection.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like `pilot_element_state` or `pilot_page_html`. It does not mention prerequisites (e.g., requiring a page to be loaded) or situations where it might return empty results.

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/TacosyHorchata/Pilot'

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