Skip to main content
Glama
patrickdappollonio

Domain Tools (WHOIS + DNS)

errors.go637 B
package utils import ( "encoding/json" "errors" "fmt" ) // ParseJSONUnmarshalError converts JSON unmarshal errors into more user-friendly error messages. func ParseJSONUnmarshalError(err error) error { // Check if it's a JSON unmarshal error var unmarshalErr *json.UnmarshalTypeError var syntaxErr *json.SyntaxError switch { case errors.As(err, &unmarshalErr): return fmt.Errorf("invalid value for field %q: expected %q but got %q", unmarshalErr.Field, unmarshalErr.Type.String(), unmarshalErr.Value) case errors.As(err, &syntaxErr): return fmt.Errorf("invalid input provided to the tool") default: return err } }

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/patrickdappollonio/mcp-domaintools'

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