ToolGen is a new framework that integrates tool knowledge directly into the parameters of large language models (LLMs), enabling them to autonomously execute tasks by interacting with external tools. Traditional methods rely on inputting tool descriptions as context, which is constrained by context length and requires separate, often inefficient, retrieval mechanisms. ToolGen solves this by representing each tool as a unique token within the LLM's vocabulary, allowing it to generate tool calls and arguments as part of its next token prediction capabilities, seamlessly blending tool invocation with language generation. Experimental results show that ToolGen significantly enhances both performance and scalability, achieving superior results in tool retrieval and autonomous task completion.