Skip to main content
Glama
jomon003

PlayMCP Browser Automation Server

by jomon003

getMetaTags

Extract all meta tags from web pages to analyze SEO elements, structured data, and page metadata for automation and analysis tasks.

Instructions

Get all meta tags from the current page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function that retrieves all meta tags from the current page by evaluating JavaScript on the page to query 'meta' elements and extract name, property, content, and httpEquiv attributes.
    async getMetaTags(): Promise<Array<{name?: string, property?: string, content?: string, httpEquiv?: string}>> {
      try {
        if (!this.isInitialized()) {
          throw new Error('Browser not initialized');
        }
        this.log('Getting meta tags');
        const metaTags = await this.state.page?.evaluate(() => {
          const metaElements = Array.from(document.querySelectorAll('meta'));
          return metaElements.map(meta => ({
            name: meta.getAttribute('name') || undefined,
            property: meta.getAttribute('property') || undefined,
            content: meta.getAttribute('content') || undefined,
            httpEquiv: meta.getAttribute('http-equiv') || undefined
          }));
        });
        this.log('Meta tags retrieved:', metaTags?.length);
        return metaTags || [];
      } catch (error: any) {
        console.error('Get meta tags error:', error);
        throw new BrowserError('Failed to get meta tags', 'Check if the page is loaded');
      }
    }
  • MCP callTool dispatch handler for getMetaTags that invokes the Playwright controller method and returns the JSON-stringified result.
    }      case 'getMetaTags': {
      const metaTags = await playwrightController.getMetaTags();
      return {
        content: [{ type: "text", text: JSON.stringify(metaTags, null, 2) }]
      };
    }
  • Tool schema definition, specifying name, description, and empty input schema (no parameters required).
    const GET_META_TAGS_TOOL: Tool = {
      name: "getMetaTags",
      description: "Get all meta tags from the current page",
      inputSchema: {
        type: "object",
        properties: {},
        required: []
      }
    };
  • src/server.ts:528-528 (registration)
    Registers the getMetaTags tool in the tools dictionary provided to the MCP server capabilities.
    getMetaTags: GET_META_TAGS_TOOL,
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states what the tool does but lacks behavioral details: it doesn't specify if this requires an active browser session, what format the meta tags are returned in (e.g., array of objects), or potential errors (e.g., no page loaded). This leaves gaps for an agent to use it correctly.

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, direct sentence with no wasted words. It's front-loaded with the core action ('Get all meta tags') and specifies the scope ('from the current page'), making it efficient and easy to parse.

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?

Given the tool's simplicity (0 parameters, no output schema), the description is minimally adequate but incomplete. It lacks context about prerequisites (e.g., requires a loaded page) and output details, which are important for an agent to invoke it without errors. With no annotations, more behavioral information would improve completeness.

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 tool has 0 parameters, and the input schema has 100% description coverage (though empty). The description doesn't need to explain parameters, so it appropriately focuses on the action. A baseline of 4 is given since no parameter information is required.

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 verb ('Get') and resource ('all meta tags from the current page'), making the purpose immediately understandable. It doesn't explicitly differentiate from siblings like 'getPageSource' or 'getPageText', but the specificity of 'meta tags' provides inherent distinction.

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. With siblings like 'getPageSource' (which might include meta tags) and 'getPageText' (which might not), there's no indication of when this specific extraction is preferred or what context it requires (e.g., browser must be open).

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/jomon003/PlayMCP'

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