Skip to main content
Glama
Service.swift658 B
@preconcurrency protocol Service { @ToolBuilder var tools: [Tool] { get } var isActivated: Bool { get async } func activate() async throws } extension Service { var isActivated: Bool { get async { return true } } func activate() async throws {} func call(tool name: String, with arguments: [String: Value]) async throws -> Value? { for tool in tools where tool.name == name { return try await tool.callAsFunction(arguments) } return nil } } @resultBuilder struct ToolBuilder { static func buildBlock(_ tools: Tool...) -> [Tool] { tools } }

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/mattt/iMCP'

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