### Custom Datasource Connector Example Source: https://developers.glean.com Example of a custom datasource connector for Linear, demonstrating how to define configuration and transform data into DocumentDefinition objects for Glean indexing. Requires BaseDatasourceConnector and relevant models. ```python from glean.indexing.connectors import BaseDatasourceConnector from glean.indexing.models import ( ContentDefinition, CustomDatasourceConfig, DocumentDefinition, ) from glean.api_client.models import DatasourceCategory class LinearConnector(BaseDatasourceConnector[dict]): configuration = CustomDatasourceConfig( name="linear", display_name="Linear", datasource_category=DatasourceCategory.TICKETS, ) def transform(self, issues: list[dict]) -> list[DocumentDefinition]: return [ DocumentDefinition( id=issue["id"], title=issue["title"], datasource=self.name, body=ContentDefinition( mime_type="text/plain", text_content=issue.get("description", ""), ), ) for issue in issues ] connector = LinearConnector(name="linear", data_client=client) connector.configure_datasource() connector.index_data() ``` -------------------------------- ### CrewAI Integration with Glean Search Tool Source: https://developers.glean.com Python code demonstrating how to set up a CrewAI agent with the Glean search tool. Ensure GLEAN_API_TOKEN and GLEAN_INSTANCE environment variables are set. ```python import os from crewai import Agent, Crew, Task from glean.agent_toolkit.tools import glean_search os.environ["GLEAN_API_TOKEN"] = "your-api-token" os.environ["GLEAN_INSTANCE"] = "your-instance-name" researcher = Agent( role="Research Specialist", goal="Find company docs and information", tools=[glean_search.as_crewai_tool()], ) crew = Crew(agents=[researcher], tasks=[ Task(description="Find remote work policy", agent=researcher), ]) result = crew.kickoff() ``` -------------------------------- ### OpenCode MCP Configuration (JSON) Source: https://developers.glean.com This JSON configuration defines the 'glean-developer-docs' MCP server with a remote type and its URL. ```json { "mcp": { "glean-developer-docs": { "type": "remote", "url": "https://developers.glean.com/mcp" } } } ``` -------------------------------- ### Gemini CLICLI MCP Add Command Source: https://developers.glean.com Command to add the 'glean-developer-docs' MCP server with HTTP transport. ```bash gemini mcp add --transport http glean-developer-docs https://developers.glean.com/mcp ``` -------------------------------- ### MCP Server Configuration (JSON) Source: https://developers.glean.com This JSON configuration defines the server URL for the 'glean-developer-docs' MCP server. It's used by tools like Antigravity, Antigravity CLI, Cursor, Goose, JetBrains AI Assistant, Junie, and Windsurf. ```json { "mcpServers": { "glean-developer-docs": { "serverUrl": "https://developers.glean.com/mcp" } } } ``` -------------------------------- ### CodexCLI MCP Add Command Source: https://developers.glean.com Command to add the 'glean-developer-docs' MCP server using its URL. ```bash codex mcp add --url https://developers.glean.com/mcp glean-developer-docs ``` -------------------------------- ### Cursor Agent Configuration (JSON) Source: https://developers.glean.com This JSON configuration specifies the HTTP type and URL for the 'glean-developer-docs' MCP server. It's used by Cursor Agent. ```json { "mcpServers": { "glean-developer-docs": { "type": "http", "url": "https://developers.glean.com/mcp" } } } ``` -------------------------------- ### Goose MCP Configuration (JSON) Source: https://developers.glean.com This JSON configuration defines the 'glean-developer-docs' extension for Goose, specifying it as a streamable HTTP type with a given URI and default timeout. ```json { "extensions": { "glean-developer-docs": { "enabled": true, "name": "glean-developer-docs", "type": "streamable_http", "uri": "https://developers.glean.com/mcp", "envs": {}, "env_keys": [], "headers": {}, "description": "", "timeout": 300, "bundled": null, "available_tools": [] } } } ``` -------------------------------- ### Claude CodeCLI MCP Add Command Source: https://developers.glean.com Command to add the 'glean-developer-docs' MCP server with HTTP transport and user scope. ```bash claude mcp add glean-developer-docs https://developers.glean.com/mcp --transport http --scope user ``` -------------------------------- ### VS CodeCLI MCP Add Command Source: https://developers.glean.com Command to add an MCP server configuration for VS Code CLI, specifying name, type, and URL. ```bash code --add-mcp '{"name":"glean-developer-docs","type":"http","url":"https://developers.glean.com/mcp"}' ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.