Skip to main content

estimate_tokens

function estimate_tokens

Rough estimate of token count (approximately 4 characters per token).
from mcp_use.server.utils.utils import estimate_tokens
Parameters
text
str
required
String value
Returns
returns
int
Signature
def estimate_tokens(text: str):

get_local_network_ip

function get_local_network_ip

Get the local network IP address.
from mcp_use.server.utils.utils import get_local_network_ip
Returns
returns
str | None
Signature
def get_local_network_ip():

get_return_type

function get_return_type

Get the return type annotation from a function or callable class.
from mcp_use.server.utils.utils import get_return_type
Parameters
func_or_callable
required
Parameter value
Returns
returns
type
Signature
def get_return_type(func_or_callable):