Skip to main content
Glama
get_json.rs819 B
use axum::{ Json, extract::Path, }; use dal::{ Component, component::properties::ComponentProperties, }; use sdf_extract::{ PosthogEventTracker, change_set::ChangeSetDalContext, }; use serde::{ Deserialize, Serialize, }; use super::Result; use crate::service::v2::component::ComponentIdFromPath; #[derive(Deserialize, Serialize, Debug)] #[serde(rename_all = "camelCase")] pub struct JsonResponse { pub json: ComponentProperties, } pub(crate) async fn get_json( ChangeSetDalContext(ref mut ctx): ChangeSetDalContext, _tracker: PosthogEventTracker, Path(ComponentIdFromPath { component_id }): Path<ComponentIdFromPath>, ) -> Result<Json<JsonResponse>> { let json = Component::get_json_representation(ctx, component_id).await?; Ok(Json(JsonResponse { json })) }

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/systeminit/si'

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