get_code_snippets

Get code snippets, templates, and sample repositories for Microsoft 365 agents and apps development. Covers SDKs including @microsoft/teams-ai, @microsoft/teams-js, botbuilder, @microsoft/agents-hosting, @microsoft/agents-activity, and @microsoft/teamsfx. Use this tool when looking for implementa...

Server M365agentstoolkit @microsoft/m365agentstoolkit-mcp
Category Read
Risk class Low
Parameters 11 required

What get_code_snippets does on M365agentstoolkit

AI agents call get_code_snippets to retrieve information from M365agentstoolkit without modifying anything — typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.

ParameterTypeRequiredDescription
question string Yes Query to find relevant code snippets related to Microsoft 365 app or agent SDKs

Parameters from the server's own tool schema.

Why get_code_snippets needs a policy

This is a straightforward Read category tool. It fetches and returns development templates and code examples from Microsoft 365 SDKs for educational/reference purposes. There are no write, delete, execute, or financial operations involved. The blast radius of misuse is minimal—an AI agent retrieving incorrect code samples might produce buggy output, but cannot modify systems, execute commands, or cause data loss.

From the tool's definition Tool retrieves code snippets, templates, and sample repositories—passive information retrieval with no side effects.

Questions about get_code_snippets

What does the get_code_snippets tool do? +

Get code snippets, templates, and sample repositories for Microsoft 365 agents and apps development. Covers SDKs including @microsoft/teams-ai, @microsoft/teams-js, botbuilder, @microsoft/agents-hosting, @microsoft/agents-activity, and @microsoft/teamsfx. Use this tool when looking for implementation examples, starter templates, or SDK usage patterns. It is categorised as a Read tool in the M365agentstoolkit MCP Server, which means it retrieves data without modifying state.

What parameters does get_code_snippets accept? +

get_code_snippets accepts 1 parameter: question. Required: question. The full parameter table on this page comes from the server's own tool schema.

How do I enforce a policy on get_code_snippets? +

Register the M365agentstoolkit MCP server in PolicyLayer and add a rule for get_code_snippets: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches M365agentstoolkit. Nothing to install.

What risk level is get_code_snippets? +

get_code_snippets is a Read tool with low risk. Read-only tools are generally safe to allow by default.

Can I rate-limit get_code_snippets? +

Yes. Add a rate_limit block to the get_code_snippets rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.

How do I block get_code_snippets completely? +

Set action: deny in the PolicyLayer policy for get_code_snippets. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.

What MCP server provides get_code_snippets? +

get_code_snippets is provided by the M365agentstoolkit MCP server (@microsoft/m365agentstoolkit-mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.

// LOOK UP ANOTHER SERVER

Every MCP server has a record like this.

Type a name, get the same breakdown: verified identity, auth posture, risk grade, capabilities, recommended policy.

Teams ship this data inside their own products. See what a licence covers →

// GET IN TOUCH

Have a question or want to learn more? Send us a message.

Message sent.

We'll get back to you soon.