github_mcp/tools/get_tool.rs
1// GitHub v3 REST API MCP server — generated by mcpify. Do not hand-edit.
2
3use rusqlite::Connection;
4
5use crate::core::errors::McpifyError;
6use crate::data::store::get_endpoint;
7
8/// Returns the literal schema, path, method, and documentation for a
9/// specific operationId (PRD §1.5).
10pub fn get_operation(conn: &Connection, operation_id: &str) -> anyhow::Result<serde_json::Value> {
11 let endpoint = get_endpoint(conn, operation_id)?
12 .ok_or_else(|| McpifyError::NotFound(format!("unknown operationId '{operation_id}'")))?;
13 Ok(serde_json::to_value(endpoint)?)
14}