Item-shaped results now omit empty fields and drop low-value metadata (overview, lyrics, file_path, creation_date, premiere_date, bitrate); absent numeric fields drop the key instead of emitting "". Player sessions report hh:mm:ss times only; playlists drop overview/date_created. The lyrics_or_description search parameter is removed, along with the unused DTO fields, and upstream Fields requests are slimmed to match. Module path renamed to git.i3omb.com/gronod/emby-mcp.
27 lines
768 B
Go
27 lines
768 B
Go
package server
|
|
|
|
import (
|
|
"context"
|
|
|
|
"git.i3omb.com/gronod/emby-mcp/internal/state"
|
|
"github.com/modelcontextprotocol/go-sdk/mcp"
|
|
)
|
|
|
|
func registerUserTools(s *mcp.Server, st *state.State) {
|
|
mcp.AddTool(s, &mcp.Tool{
|
|
Name: "retrieve_user_list",
|
|
Description: `Retrieves a list of user names and their user IDs from the Emby server in JSON format.
|
|
|
|
Returns:
|
|
Dict: as JSON with keys:
|
|
user_id (str): Unique user ID
|
|
user_name (str): user name`,
|
|
}, func(ctx context.Context, req *mcp.CallToolRequest, in struct{}) (*mcp.CallToolResult, any, error) {
|
|
users, err := st.Client.GetUsers(ctx, "", "")
|
|
if err != nil {
|
|
return textResult(errf("ERROR: failed to retrieve user list because: %v", err)), nil, nil
|
|
}
|
|
return jsonResult(users), nil, nil
|
|
})
|
|
}
|