Skip to main content
Glama

propublica-mcp

hooks.py•1 kB
from collections import defaultdict class Hookable: _hooks = None def __init__(self): self._hooks = defaultdict(set) def register_hook(self, hook_type, hook): self._hooks[hook_type].add(hook) def execute_hook(self, hook_type, *args, **kwargs): for hook in self._hooks[hook_type]: hook(self, *args, **kwargs) def hooked(func=None, before=None, after=None): """Execute hooks before and after the decorated method.""" def decorator(func): before_name = before or f"before_{func.__name__}" after_name = after or f"after_{func.__name__}" def wrapper(self, *args, **kwargs): self.execute_hook(before_name, *args, **kwargs) result = func(self, *args, **kwargs) self.execute_hook(after_name, result) return result return wrapper # The decorator has been called without parenthesis if callable(func): return decorator(func) return decorator

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/asachs01/propublica-mcp'

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