Skip to main content
Glama

Convex MCP server

Official
by get-convex
utils.rs1.38 kB
use std::{ fmt, fmt::Display, }; fn display_composite<K: Display, V: Display, I: Iterator<Item = (Option<K>, V)>>( f: &mut fmt::Formatter, enclosing: [&str; 2], items: I, ) -> fmt::Result { let mut first = true; write!(f, "{}", enclosing[0])?; for (key, value) in items { if !first { write!(f, ", ")?; } if let Some(key) = key { write!(f, "{key}: ")?; } write!(f, "{value}")?; first = false; } write!(f, "{}", enclosing[1]) } /// Format an iterator of `items` with a comma separator and enclosed by /// `enclosing[0]` and `enclosing[1]`. pub fn display_sequence<V: Display>( f: &mut fmt::Formatter, enclosing: [&str; 2], items: impl Iterator<Item = V>, ) -> fmt::Result { // Since we're passing in `None` for the key type, we need to pass in something // for the first type parameter to help type inference out. display_composite::<usize, V, _>(f, enclosing, items.map(|v| (None, v))) } /// Format an iterator of key-value pairs with a comma separator and enclosed by /// `enclosing[0]` and `enclosing[1]`. pub fn display_map<K: Display, V: Display>( f: &mut fmt::Formatter, enclosing: [&str; 2], items: impl Iterator<Item = (K, V)>, ) -> fmt::Result { display_composite(f, enclosing, items.map(|(k, v)| (Some(k), v))) }

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/get-convex/convex-backend'

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