get_domain_info
Retrieve domain registration details including status, expiration date, and nameservers for any registered domain.
Instructions
Get detailed information about a registered domain (status, expiry, nameservers, etc.).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes | Fully qualified domain name (e.g., 'example.com') |
Implementation Reference
- src/tools/domain-info.ts:12-44 (handler)The getDomainInfo function that executes the get_domain_info tool logic. It authenticates the client, makes a GET request to /domains/:domain, formats the response (status, expiry, nameservers, etc.) and returns it as text content.
export async function getDomainInfo( client: BloomfilterClient, params: { domain: string }, ): Promise<McpToolResult> { const keyError = client.requiresPrivateKey(); if (keyError) return keyError; try { await client.ensureAuth(); const { data } = await client.http.get<DomainInfoResponse>( `/domains/${encodeURIComponent(params.domain)}`, { headers: client.getAuthHeaders() }, ); const nameservers = data.nameservers?.length ? data.nameservers.join(", ") : "none"; const text = [ `Domain: ${data.domain}`, `Status: ${data.status}`, `Created: ${data.registeredAt}`, `Expires: ${data.expiresAt}`, `Auto-Renew: ${data.autoRenew ? "Yes" : "No"}`, `Locked: ${data.locked ? "Yes" : "No"}`, `Nameservers: ${nameservers}`, `Owner: ${data.walletAddress}`, ].join("\n"); return { content: [{ type: "text", text }] }; } catch (error) { return formatToolError(error); } } - src/types.ts:75-84 (schema)DomainInfoResponse interface defines the output schema for the get_domain_info tool, specifying the structure of domain information returned from the API.
export interface DomainInfoResponse { domain: string; status: string; registeredAt: string; expiresAt: string; autoRenew: boolean; locked: boolean; nameservers: string[]; walletAddress: string; } - src/index.ts:107-115 (registration)Registration of the get_domain_info tool with the MCP server, defining its name, description, input schema (domain parameter), and handler function.
// 3. get_domain_info server.tool( "get_domain_info", "Get detailed information about a registered domain (status, expiry, nameservers, etc.).", { domain: z.string().describe("Fully qualified domain name (e.g., 'example.com')"), }, async (params) => getDomainInfo(client, params), );