Skip to main content
Glama
nks-hub

rybbit-mcp

by nks-hub

Create Goal

rybbit_create_goal

Create a conversion goal for your site by setting a URL path pattern for path-based goals or defining an event name and optional property filters for event-based goals.

Instructions

Create a new conversion goal for a site. Goal can be path-based (URL match) or event-based (custom event triggered).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
siteIdYesSite ID (numeric ID or domain identifier)
nameNoOptional display name for the goal
goalTypeYes'path' = URL pattern, 'event' = custom event
configYesGoal configuration. Use pathPattern for path goals or eventName for event goals.

Implementation Reference

  • Registration of the 'rybbit_create_goal' tool on the MCP server with its metadata (title, description, annotations, inputSchema).
    server.registerTool(
      "rybbit_create_goal",
      {
        title: "Create Goal",
        description:
          "Create a new conversion goal for a site. Goal can be path-based (URL match) or event-based (custom event triggered).",
        annotations: {
          readOnlyHint: false,
          idempotentHint: false,
          openWorldHint: true,
          destructiveHint: false,
        },
        inputSchema: {
          siteId: siteIdSchema,
          name: z.string().optional().describe("Optional display name for the goal"),
          goalType: z.enum(["path", "event"]).describe("'path' = URL pattern, 'event' = custom event"),
          config: goalConfigSchema,
        },
      },
      async (args) => {
        try {
          const { siteId, ...body } = args as {
            siteId: string;
            name?: string;
            goalType: "path" | "event";
            config: Record<string, unknown>;
          };
    
          const data = await client.post(`/sites/${siteId}/goals`, body);
          return {
            content: [{ type: "text" as const, text: truncateResponse(data) }],
          };
        } catch (err) {
          const message = err instanceof Error ? err.message : String(err);
          return {
            content: [{ type: "text" as const, text: `Error: ${message}` }],
            isError: true,
          };
        }
      }
    );
  • Handler function that executes the tool logic: destructures args (siteId + body), makes a POST request to /sites/{siteId}/goals, and returns the response or an error.
    async (args) => {
      try {
        const { siteId, ...body } = args as {
          siteId: string;
          name?: string;
          goalType: "path" | "event";
          config: Record<string, unknown>;
        };
    
        const data = await client.post(`/sites/${siteId}/goals`, body);
        return {
          content: [{ type: "text" as const, text: truncateResponse(data) }],
        };
      } catch (err) {
        const message = err instanceof Error ? err.message : String(err);
        return {
          content: [{ type: "text" as const, text: `Error: ${message}` }],
          isError: true,
        };
      }
    }
  • The 'goalConfigSchema' used by the tool's inputSchema for the config field. Defines goal configuration with pathPattern, eventName, eventPropertyKey/Value, and propertyFilters.
    const goalConfigSchema = z
      .object({
        pathPattern: z
          .string()
          .optional()
          .describe("Path pattern (required when goalType='path'). Supports wildcards like /products/*"),
        eventName: z
          .string()
          .optional()
          .describe("Event name (required when goalType='event')"),
        eventPropertyKey: z
          .string()
          .optional()
          .describe("Event property key to match (optional, must be paired with eventPropertyValue)"),
        eventPropertyValue: z
          .union([z.string(), z.number(), z.boolean()])
          .optional()
          .describe("Event property value to match (optional, must be paired with eventPropertyKey)"),
        propertyFilters: z
          .array(
            z.object({
              key: z.string(),
              value: z.union([z.string(), z.number(), z.boolean()]),
            })
          )
          .optional()
          .describe("Multiple property filters (alternative to single eventPropertyKey/Value pair)"),
      })
      .describe("Goal configuration. Use pathPattern for path goals or eventName for event goals.");
  • src/index.ts:47-48 (registration)
    Top-level registration call: registerGoalsTools(server, client) wires up all the goals tools including rybbit_create_goal.
    registerGoalsTools(server, client);
    registerJourneysTools(server, client);
Behavior3/5

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

Annotations already indicate non-read-only and non-destructive behavior. The description adds 'Create' which is consistent. It does not elaborate on side effects, permissions, or other behavioral nuances beyond what annotations provide.

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?

The description is a single, well-structured sentence that immediately conveys the tool's purpose and key differentiator (path vs. event). No wasted words.

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

Completeness4/5

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

Given the tool's complexity (4 parameters, nested object) and the complete schema annotations, the description is adequate. However, it does not mention return values or confirmation of creation, which could be helpful but is not critical.

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 detailed descriptions for all parameters. The description only repeats the high-level concept of path vs. event, adding minimal value beyond the schema.

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?

The description clearly states the tool creates a new conversion goal for a site and specifies two types (path-based and event-based), distinguishing it from sibling tools like rybbit_update_goal, rybbit_list_goals, and rybbit_delete_goal.

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

Usage Guidelines4/5

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

The description implies usage for creating conversion goals, but lacks explicit guidance on when to use path vs. event types or when not to use this tool. However, the context of sibling tools (e.g., update, delete) makes the purpose clear.

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