sites_get
Retrieve site property details from Google Search Console to access search analytics, sitemap data, and indexing information for a specific URL.
Instructions
Retrieve information about a specific site (property) in Google Search Console.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| siteUrl | Yes | The site URL (e.g. 'https://example.com/' or 'sc-domain:example.com') |
Implementation Reference
- src/index.ts:153-174 (handler)The registration and handler implementation for the "sites_get" tool. It takes `siteUrl` as an input and calls the Google Webmasters API to retrieve site details.
server.tool( "sites_get", "Retrieve information about a specific site (property) in Google Search Console.", { siteUrl: z .string() .describe( "The site URL (e.g. 'https://example.com/' or 'sc-domain:example.com')", ), }, async ({ siteUrl }) => { try { const result = await apiCall( `${WEBMASTERS_BASE}/sites/${encodeSiteUrl(siteUrl)}`, { method: "GET" }, ); return toolResult(result); } catch (e) { return errorResult(e); } }, );