Skip to main content

database_mcp_postgres/
types.rs

1//! PostgreSQL-specific MCP tool request types.
2//!
3//! These types include PostgreSQL-only parameters like `cascade`
4//! that are not available on other backends.
5
6use rmcp::schemars;
7use rmcp::schemars::JsonSchema;
8use serde::Deserialize;
9
10/// Request for the `drop_table` tool.
11#[derive(Debug, Default, Deserialize, JsonSchema)]
12pub struct DropTableRequest {
13    /// The database containing the table. Required. Use `list_databases` first to see available databases.
14    pub database_name: String,
15    /// Name of the table to drop. Must contain only alphanumeric characters and underscores.
16    pub table_name: String,
17    /// If true, use CASCADE to also drop dependent foreign key constraints. Defaults to false.
18    #[serde(default)]
19    pub cascade: bool,
20}