Skip to content

generateHandler needs to call the client and extract parameters from the mcp requests #4

@erikist

Description

@erikist

For example, with the current SetVibe proto -- we should call through to the client:

func (s *vibeServiceMCPServer) SetVibeHandler(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error) {
	// TODO: Implement the handler for SetVibe
	// Example: Extract the vibe from the request and call the underlying service
	vibe, ok := req.Params.Arguments["vibe"].(string)
	if !ok {
		return nil, errors.New("vibe not a string")
	}

	// Call the driver client to get drivers
	res, err := s.SetVibe(ctx, &SetVibeRequest{
		Vibe: vibe,
	})

	if err != nil {
		return nil, err
	}

	//TODO: think about this response
	return mcp.NewToolResultText(res.Vibe), nil
}

I have some open questions in general around what those tool results should be returning and we need to explore that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions