We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/fosdickio/binary_ninja_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
string_utils.py•568 B
def escape_non_ascii(input_str: str) -> str:
"""Escape non-ASCII characters in a string"""
if input_str is None:
return ""
result = ""
for c in input_str:
if 32 <= ord(c) < 127:
result += c
else:
result += f"\\x{ord(c):02x}"
return result
def parse_int_or_default(val: str, default: int) -> int:
"""Parse an integer from a string or return a default value"""
if val is None:
return default
try:
return int(val)
except (ValueError, TypeError):
return default