Skip to main content
Glama
nks-hub

rybbit-mcp

by nks-hub

Get Site ID by Domain

rybbit_get_site_id
Read-onlyIdempotent

Find the numeric site ID for a domain to query Rybbit Analytics data. Input a domain name to get the identifier needed for API requests.

Instructions

Look up a site by domain name. Returns the numeric siteId used for analytics API queries. Note: for SDK tracking setup, use the hash siteId returned by rybbit_create_site instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYesDomain to search for (e.g. 'example.com'). Partial match supported.

Implementation Reference

  • The 'rybbit_get_site_id' tool is registered and implemented in src/tools/config.ts. It fetches organizations, iterates through sites, and returns matches for a given domain.
    server.registerTool(
      "rybbit_get_site_id",
      {
        title: "Get Site ID by Domain",
        description:
          "Look up a site by domain name. Returns the numeric siteId used for analytics API queries. Note: for SDK tracking setup, use the hash siteId returned by rybbit_create_site instead.",
        inputSchema: {
          domain: z
            .string()
            .describe(
              "Domain to search for (e.g. 'example.com'). Partial match supported."
            ),
        },
        annotations: {
          readOnlyHint: true,
          destructiveHint: false,
          idempotentHint: true,
          openWorldHint: true,
        },
      },
      async ({ domain }) => {
        try {
          const orgs = await client.get<Organization[]>("/organizations");
          const matches: { siteId: string; domain: string; name: string; organization: string }[] = [];
    
          for (const org of orgs) {
            for (const site of org.sites ?? []) {
              if (
                site.domain.toLowerCase().includes(domain.toLowerCase()) ||
                domain.toLowerCase().includes(site.domain.toLowerCase())
              ) {
                matches.push({
                  siteId: site.id,
                  domain: site.domain,
                  name: site.name,
                  organization: String(org.name),
                });
              }
            }
          }
    
          if (matches.length === 0) {
            return {
              content: [
                {
                  type: "text" as const,
                  text: `No site found matching '${domain}'. Use rybbit_list_sites to see all available sites, or rybbit_create_site to create one.`,
                },
              ],
            };
          }
    
          return {
            content: [
              {
                type: "text" as const,
                text: truncateResponse(
                  matches.length === 1 ? matches[0] : matches
                ),
              },
            ],
          };
        } catch (err) {
          const message = err instanceof Error ? err.message : String(err);
          return {
            content: [{ type: "text" as const, text: `Error: ${message}` }],
            isError: true,
          };
        }
      }
    );
Behavior4/5

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

Annotations declare read-only/idempotent safety. Description adds crucial context that return value is numeric siteId (distinct from hash format) and specifies 'analytics API queries' as the intended use case. Could elaborate on error states, but coverage is solid.

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?

Three sentences deliver purpose, return value, and sibling distinction without redundancy. Front-loaded with core action ('Look up'), zero waste, and the cautionary note earns its place by preventing integration errors.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter lookup tool with comprehensive annotations, the description adequately covers purpose, return type semantics, and critical sibling differentiation. No output schema exists but tool simplicity makes this acceptable.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with 'domain' fully documented including partial match support. Description mentions 'by domain name' but adds no syntax or format details beyond schema, warranting baseline score for high-coverage schemas.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States specific action 'Look up' with resource 'site' and filter 'by domain name'. Critically distinguishes from sibling rybbit_create_site by clarifying this returns numeric siteId for analytics APIs versus the hash siteId needed for SDK tracking.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when NOT to use the tool ('for SDK tracking setup') and names the correct alternative ('use the hash siteId returned by rybbit_create_site instead'), providing unambiguous guidance against misuse.

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/nks-hub/rybbit-mcp'

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