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,

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