// Bitbucket Data Center MCP server — generated by mcpify. Do not hand-edit.

use bitbucket_dc_mcp::core::config_manager::load_config;
use bitbucket_dc_mcp::data::store::cached_store_connection;
use bitbucket_dc_mcp::tools::search_tool::search_operations;

pub async fn run(query: &str, limit: usize) -> anyhow::Result<()> {
    let config = load_config(serde_json::Map::new())?;
    let conn = cached_store_connection(&config.api_version)?
        .lock()
        .unwrap();
    let results = search_operations(&conn, query, limit)?;
    println!("{}", serde_json::to_string_pretty(&results)?);
    Ok(())
}
