// {{ display_name }} MCP server — generated by mcpify. Do not hand-edit.

use rusqlite::Connection;

use crate::core::errors::McpifyError;
use crate::data::store::get_endpoint;

/// Returns the literal schema, path, method, and documentation for a
/// specific operationId (PRD §1.5).
pub fn get_operation(conn: &Connection, operation_id: &str) -> anyhow::Result<serde_json::Value> {
    let endpoint = get_endpoint(conn, operation_id)?
        .ok_or_else(|| McpifyError::NotFound(format!("unknown operationId '{operation_id}'")))?;
    Ok(serde_json::to_value(endpoint)?)
}
