Skip to main content
Glama
confluentinc

mcp-confluent

Official
by confluentinc

delete-flink-statements

Remove specific Flink statements by sending requests to the Flink REST API, using organization, environment, and statement identifiers.

Instructions

Make a request to delete a statement.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
baseUrlNoThe base URL of the Flink REST API.
environmentIdNoThe unique identifier for the environment.
organizationIdNoThe unique identifier for the organization.
statementNameYesThe user provided name of the resource, unique within this environment.

Implementation Reference

  • The DeleteFlinkStatementHandler class implements the core logic for the 'delete-flink-statements' tool. It parses input arguments, ensures required parameters, makes a DELETE request to the Confluent Cloud Flink SQL API to delete the specified statement, and returns the status.
    export class DeleteFlinkStatementHandler extends BaseToolHandler {
      async handle(
        clientManager: ClientManager,
        toolArguments: Record<string, unknown> | undefined,
      ): Promise<CallToolResult> {
        const { statementName, environmentId, organizationId, baseUrl } =
          deleteFlinkStatementArguments.parse(toolArguments);
        const organization_id = getEnsuredParam(
          "FLINK_ORG_ID",
          "Organization ID is required",
          organizationId,
        );
        const environment_id = getEnsuredParam(
          "FLINK_ENV_ID",
          "Environment ID is required",
          environmentId,
        );
    
        if (baseUrl !== undefined && baseUrl !== "") {
          clientManager.setConfluentCloudFlinkEndpoint(baseUrl);
        }
        const pathBasedClient = wrapAsPathBasedClient(
          clientManager.getConfluentCloudFlinkRestClient(),
        );
        const { response, error } = await pathBasedClient[
          "/sql/v1/organizations/{organization_id}/environments/{environment_id}/statements/{statement_name}"
        ].DELETE({
          params: {
            path: {
              organization_id: organization_id,
              environment_id: environment_id,
              statement_name: statementName,
            },
          },
        });
        if (error) {
          return this.createResponse(
            `Failed to delete Flink SQL statement: ${JSON.stringify(error)}`,
            true,
          );
        }
        return this.createResponse(
          `Flink SQL Statement Deletion Status Code: ${response?.status}`,
        );
      }
      getToolConfig(): ToolConfig {
        return {
          name: ToolName.DELETE_FLINK_STATEMENTS,
          description: "Make a request to delete a statement.",
          inputSchema: deleteFlinkStatementArguments.shape,
        };
      }
    
      getRequiredEnvVars(): EnvVar[] {
        return ["FLINK_API_KEY", "FLINK_API_SECRET"];
      }
    
      isConfluentCloudOnly(): boolean {
        return true;
      }
    }
  • Zod input schema defining the parameters for the delete-flink-statements tool: baseUrl (optional Flink REST endpoint), organizationId (optional), environmentId (optional), and statementName (required, with regex validation).
    const deleteFlinkStatementArguments = z.object({
      baseUrl: z
        .string()
        .trim()
        .describe("The base URL of the Flink REST API.")
        .url()
        .default(() => env.FLINK_REST_ENDPOINT ?? "")
        .optional(),
      organizationId: z
        .string()
        .trim()
        .optional()
        .describe("The unique identifier for the organization."),
      environmentId: z
        .string()
        .trim()
        .optional()
        .describe("The unique identifier for the environment."),
      statementName: z
        .string()
        .regex(
          new RegExp(
            "[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*",
          ),
        )
        .nonempty()
        .max(100)
        .describe(
          "The user provided name of the resource, unique within this environment.",
        ),
    });
  • Registration of the DeleteFlinkStatementHandler in the ToolFactory's handlers Map under the key ToolName.DELETE_FLINK_STATEMENTS.
    [ToolName.DELETE_FLINK_STATEMENTS, new DeleteFlinkStatementHandler()],
  • Import of the DeleteFlinkStatementHandler class in tool-factory.ts for registration.
    import { DeleteFlinkStatementHandler } from "@src/confluent/tools/handlers/flink/delete-flink-statement-handler.js";
  • Enum constant defining the tool name 'delete-flink-statements'.
    DELETE_FLINK_STATEMENTS = "delete-flink-statements",
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'delete a statement,' implying a destructive mutation, but fails to disclose critical traits such as whether deletion is permanent, requires specific permissions, has side effects (e.g., stopping associated jobs), or what happens on success/failure. This is inadequate for a mutation tool with zero annotation coverage.

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, efficient sentence with zero waste, making it appropriately sized and front-loaded. It directly states the action without unnecessary elaboration, though this conciseness comes at the cost of completeness in other dimensions.

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

Completeness2/5

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

Given the tool's complexity (a destructive operation with 4 parameters) and lack of annotations and output schema, the description is incomplete. It does not cover behavioral aspects, usage context, or return values, leaving significant gaps for an AI agent to understand and invoke the tool correctly in a real-world scenario.

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 description coverage is 100%, with all parameters documented in the input schema (baseUrl, environmentId, organizationId, statementName). The description adds no meaning beyond the schema, as it does not explain parameter relationships, dependencies, or usage examples. Baseline 3 is appropriate when the schema does the heavy lifting, but no extra value is added.

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

Purpose2/5

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

The description 'Make a request to delete a statement' is a tautology that restates the tool name 'delete-flink-statements' without adding specificity. It mentions the verb 'delete' and resource 'statement' but lacks details about what type of statement (Flink SQL statement) or what system it operates on, making it vague compared to more specific sibling tools like 'delete-connector' or 'delete-topics'.

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

Usage Guidelines1/5

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

The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites (e.g., needing an existing statement to delete), exclusions, or related tools like 'list-flink-statements' for selection or 'create-flink-statement' for creation, leaving the agent without context for appropriate usage.

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

Related 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/confluentinc/mcp-confluent'

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