Skip to main content
Glama
map.rs957 B
use async_trait::async_trait; use serde::{ Deserialize, Serialize, }; use serde_json::{ Map, Value, }; use crate::func::backend::{ FuncBackend, FuncBackendResult, }; #[derive(Deserialize, Serialize, Debug, Clone)] pub struct FuncBackendMapArgs { pub value: Map<String, Value>, } impl FuncBackendMapArgs { pub fn new(value: Map<String, Value>) -> Self { Self { value } } } #[derive(Deserialize, Serialize, Debug, Clone)] pub struct FuncBackendMap { args: FuncBackendMapArgs, } #[async_trait] impl FuncBackend for FuncBackendMap { type Args = FuncBackendMapArgs; fn new(args: Self::Args) -> Box<Self> { Box::new(Self { args }) } async fn inline( self: Box<Self>, ) -> FuncBackendResult<(Option<serde_json::Value>, Option<serde_json::Value>)> { let value = serde_json::to_value(&self.args.value)?; Ok((Some(value), Some(serde_json::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