resolve_handle
Convert a user handle to its corresponding decentralized identifier (DID) using the Bluesky Social MCP server. Retrieve DID information for accurate user identification.
Instructions
Resolve a handle to a DID.
Args:
ctx: MCP context
handle: User handle to resolve (e.g. "user.bsky.social")
Returns:
Resolved DID information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| handle | Yes |
Implementation Reference
- server.py:666-699 (handler)The main handler function for the 'resolve_handle' tool. It resolves a Bluesky handle to its DID using the authenticated atproto Client instance. Includes input validation implicitly via type hints and comprehensive error handling.@mcp.tool() def resolve_handle( ctx: Context, handle: str, ) -> Dict: """Resolve a handle to a DID. Args: ctx: MCP context handle: User handle to resolve (e.g. "user.bsky.social") Returns: Resolved DID information """ try: bluesky_client = get_authenticated_client(ctx) resolved = bluesky_client.resolve_handle(handle) # Convert the response to a dictionary if hasattr(resolved, "model_dump"): resolved_data = resolved.model_dump() else: resolved_data = resolved return { "status": "success", "handle": handle, "did": resolved_data.get("did"), } except Exception as e: error_msg = f"Failed to resolve handle: {str(e)}" return {"status": "error", "message": error_msg}