index_inspect
Check if a URL is indexed or can be indexed in Google Search Console to verify search visibility and identify indexing issues.
Instructions
Inspect a URL to see if it is indexed or can be indexed
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| siteUrl | Yes | The site URL as defined in Search Console. Example: sc-domain:example.com (for domain resources) or http://www.example.com/ (for site prefix resources) | |
| inspectionUrl | Yes | The fully-qualified URL to inspect. Must be under the property specified in "siteUrl" | |
| languageCode | No | An IETF BCP-47 language code representing the language of the requested translated issue messages, such as "en-US" or "de-CH". Default is "en-US" | en-US |
Implementation Reference
- src/search-console.ts:230-233 (handler)Core handler function that executes the index inspection using the Google Search Console API's urlInspection.index.inspect method.async indexInspect(requestBody: IndexInspectRequest) { const searchConsole = await this.getSearchConsole(); return searchConsole.urlInspection.index.inspect({ requestBody }); }
- src/index.ts:291-306 (handler)Dispatch handler in the main tool request switch that parses arguments, prepares the request body, calls the core indexInspect function, and formats the response.case 'index_inspect': { const args = IndexInspectSchema.parse(request.params.arguments); const requestBody = { siteUrl: args.siteUrl, inspectionUrl: args.inspectionUrl, languageCode: args.languageCode, }; const response = await searchConsole.indexInspect(requestBody); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], };
- src/schemas.ts:45-58 (schema)Zod schema defining the input parameters for the index_inspect tool: siteUrl, inspectionUrl, and optional languageCode.export const IndexInspectSchema = GSCBaseSchema.extend({ inspectionUrl: z .string() .describe( 'The fully-qualified URL to inspect. Must be under the property specified in "siteUrl"', ), languageCode: z .string() .optional() .default('en-US') .describe( 'An IETF BCP-47 language code representing the language of the requested translated issue messages, such as "en-US" or "de-CH". Default is "en-US"', ), });
- src/index.ts:63-67 (registration)Tool registration in the ListTools response, defining the name, description, and input schema for index_inspect.{ name: 'index_inspect', description: 'Inspect a URL to see if it is indexed or can be indexed', inputSchema: zodToJsonSchema(IndexInspectSchema), },
- src/search-console.ts:9-10 (schema)Type definition for the IndexInspectRequest body used in the core handler, derived from Google API types.type IndexInspectRequest = searchconsole_v1.Params$Resource$Urlinspection$Index$Inspect['requestBody'];