Skip to main content
Glama

Storyden

by Southclaws
Mozilla Public License 2.0
229
indexer.go1.26 kB
package thread_semdex import ( "context" "github.com/Southclaws/fault" "github.com/Southclaws/fault/fctx" "github.com/rs/xid" "github.com/Southclaws/storyden/app/resources/pagination" "github.com/Southclaws/storyden/app/resources/post" "github.com/Southclaws/storyden/app/resources/post/thread_writer" "github.com/Southclaws/storyden/app/resources/visibility" ) func (i *semdexer) indexThread(ctx context.Context, id post.ID) error { p, err := i.threadQuerier.Get(ctx, id, pagination.Parameters{}, nil) if err != nil { return fault.Wrap(err, fctx.With(ctx)) } if p.Visibility != visibility.VisibilityPublished { return nil } updates, err := i.semdexMutator.Index(ctx, p) if err != nil { return fault.Wrap(err, fctx.With(ctx)) } if updates > 0 { _, err = i.threadWriter.Update(ctx, id, thread_writer.WithIndexed()) if err != nil { return fault.Wrap(err, fctx.With(ctx)) } } return nil } func (i *semdexer) deindexThread(ctx context.Context, id post.ID) error { _, err := i.semdexMutator.Delete(ctx, xid.ID(id)) if err != nil { return fault.Wrap(err, fctx.With(ctx)) } _, err = i.threadWriter.Update(ctx, id, thread_writer.WithIndexed()) if err != nil { return fault.Wrap(err, fctx.With(ctx)) } return nil }

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/Southclaws/storyden'

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