Skip to main content
Glama
jezweb

Australian Postcodes MCP Server

common.py1.02 kB
""" common utilities """ from __future__ import annotations from typing import ( Any, Literal, ) def _mklbl(prefix: str, n: int): return [f"{prefix}{i}" for i in range(n)] def check_indexing_smoketest_or_raises( obj, method: Literal["iloc", "loc"], key: Any, axes: Literal[0, 1] | None = None, fails=None, ) -> None: if axes is None: axes_list = [0, 1] else: assert axes in [0, 1] axes_list = [axes] for ax in axes_list: if ax < obj.ndim: # create a tuple accessor new_axes = [slice(None)] * obj.ndim new_axes[ax] = key axified = tuple(new_axes) try: getattr(obj, method).__getitem__(axified) except (IndexError, TypeError, KeyError) as detail: # if we are in fails, the ok, otherwise raise it if fails is not None: if isinstance(detail, fails): return raise

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/jezweb/australian-postcodes-mcp'

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