File size: 921 Bytes
57f808e
 
768b26e
57f808e
 
 
 
 
 
 
854c5e9
57f808e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from lynxkite_core import ops
from lynxkite_graph_analytics import core

lsop = ops.op_registration(
    "LynxKite Graph Analytics", "LynxScribe", dir="bottom-to-top", color="blue"
)
dsop = ops.op_registration("LynxKite Graph Analytics", "Data Science")


@lsop("MCP: Query database with SQL", color="green")
def sql_tool(db: str):
    return {
        "command": ["npx", "-y", "mcp-sqlite", db],
        "extra_prompt": """
When using the database, retrieve the list of tables, investigate the schema of the relevant tables
and use SQL queries. Always set a limit of 10 when using `read_records`. Unfortunately, `read_records`
is out of order currently. Please use `query` instead."
        """.strip(),
    }


@ops.output_position(output="top")
@dsop("Database")
def db(data_pipeline: list[core.Bundle]):
    # The source of this file: https://github.com/biggraph/lynxscribe/pull/416
    return "movie_data.sqlite.db"