We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/TheLunarCompany/lunar'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
import { Tool } from "../model/target-servers.js";
export interface TokenEncoder {
encode(text: string): number[];
}
export class ToolTokenEstimator {
constructor(private readonly encoding: TokenEncoder) {}
estimateTokens(tool: Tool): number {
const serialized = JSON.stringify({
name: tool.name,
description: tool.description,
inputSchema: tool.inputSchema,
});
return this.encoding.encode(serialized).length;
}
}